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

debounceWait is not working as expected in universal mode #468

Closed
AndrewBogdanovTSS opened this issue Oct 8, 2019 · 8 comments · Fixed by #469
Closed

debounceWait is not working as expected in universal mode #468

AndrewBogdanovTSS opened this issue Oct 8, 2019 · 8 comments · Fixed by #469

Comments

@AndrewBogdanovTSS
Copy link

Version: 2.3.0

How to recreate:
Add

head() {
      this.$meta().setOptions({debounceWait: 50})
    },

into layouts/default.vue

Result:
All meta info is undefined. Page meta is not updated on router change.

Removing debounceWait fixes an issue

@pimlie
Copy link
Collaborator

pimlie commented Oct 8, 2019

The head function is not really the place to change options, better to do that in a created hook or something like that.

@AndrewBogdanovTSS
Copy link
Author

@pimlie strange, as far as I remember, you've been recommending to do this in head()

@pimlie
Copy link
Collaborator

pimlie commented Oct 8, 2019

But still it shouldnt error out, there seems to be a regression now when you dont return anything in head/metaInfo

@AndrewBogdanovTSS
Copy link
Author

I see...the fact that I used head() without returning anything caused an override of the internal components head() data, right?

@pimlie
Copy link
Collaborator

pimlie commented Oct 8, 2019

no, the issue is that vue-meta returns early when the result is not an object but that also means child components wont be traversed.

Have a fix ready, just trying to add a test for it now

@pimlie
Copy link
Collaborator

pimlie commented Oct 8, 2019

See linked pr

@AndrewBogdanovTSS
Copy link
Author

@pimlie so it would be safe to set options in head() after this PR?
Do you recommend to still set them in created hook or it's better to be done in head ?

@pimlie
Copy link
Collaborator

pimlie commented Oct 9, 2019

Changing options should be done outside of the metaInfo / head function. That is specifically meant for collecting meta info and can be called many times during the lifecycle of a Vue app.

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.

2 participants