Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.5.4 breaks metaInfo reactivity #269

Closed
kchung opened this issue Sep 26, 2018 · 5 comments · Fixed by #273
Closed

v1.5.4 breaks metaInfo reactivity #269

kchung opened this issue Sep 26, 2018 · 5 comments · Fixed by #273

Comments

@kchung
Copy link

kchung commented Sep 26, 2018

#261 and #262 introduced a breaking feature to the reactivity of metaInfo

For example, this component incrementally updates the title prop:

<script>
export default {
  name: 'app',
  metaInfo() {
    return {
      title: this.title,
    };
  },
  data() {
    return {
      increment: 0,
      title: 'test',
    };
  },
  mounted() {
    setInterval(() => {
      // The title will *not* reactively update with 1.5.4
      this.title = `title-${this.increment++}`;
    }, 500);
  },
}
</script>

In v1.5.4 it doesn't react to any of the changes like v1.5.3 does.

v1.5.3

1 5 3

v1.5.4 (this is a gif)

1 5 4

I created a test project to demonstrate the issue:

You can test by running npm run serve after running npm install

@yikuo123
Copy link

I encountered the same problem

@manniL
Copy link
Member

manniL commented Sep 27, 2018

Thanks for the detailed issue! We will look into it ☺️

@Sociopacific
Copy link

same problem

@homerjam
Copy link

I've got this issue too. After upgrading a Nuxt project to v2.0 the page titles stopped updating. Downgrading has fixed the issue for the time being npm i -S vue-meta@1.5.3.

Having looked at the recent commit history I think it must be something to do with this. My guess is that by merging the nested options the original objects/prototypes/references are lost. I think this breaks the reactivity because AFAIK reactivity is basically monkey patching set/get methods.

@manniL
Copy link
Member

manniL commented Sep 29, 2018

Thanks all! Resolved with vue-meta@1.5.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants