Closed shalldie closed 5 years ago
Thanks for reporting. Let me investigate to see what's going on there.
Hi @shalldie it's part of ComponentOptions
...
try following:
@Component({
...,
watchQuery: ['label', 'page']
})
export default class IndexPage extends Vue {
...
@hartmut-co-uk
yes it works for me. Thank u.
But it seems that i should to write the .d.ts
extend for type ComponentOptions
by myself?
This lib says it add hooks for class, so i think watchQuery
could be a field/method of class ,which likes asyncData
.
Apologies, I didn't notice there's been new releases since yesterday - I'll have another look tomorrow.
I found that,
watchQuery
must be part of ComponentOptions
layout
must be a static field of class
.
I think thease should be the fields of class instance
, or, a description should be in the readme.md
@shalldie have this been resolved or you still have the problem?
@husayt it works with what @hartmut-co-uk said, let me close this issue.
Can we have some clarity here? I don't think I understand the accepted workaround.
I get typing error when I add watchQuery
to @Component
watchQuery
can't work withv2.1.3
I tried it like this:
So strange, i see other hooks like
asyncData
works well, butwatchQuery
does nothing when query changes.Here is a repository to show a demo: https://github.com/shalldie/nuxt-ts-watchQuery