When enter a page for the first time, SSR and SPA perform different.
I know, SSR will return a static HTML for the first time, then Hydrate(active) the page.
But still I can't figure out
For SSR:
export default {
asyncData() {
return {
paramA: {}
}
},
data() {
return {
paramB: {}
}
},
watch: {
paramA: function(newValue) {
console.log('paramA', newValue) // won't print unless 'immediate: true'
},
paramB: function(newValue) {
// Here is what i'm confusing
// will print whether 'immediate: true' or not, **Why?**
console.log('paramB', newValue)
}
}
}
For Pure Vue SPA:
export default {
data() {
return {
paramC: {}
}
},
watch: {
paramC: function(newValue) {
console.log('paramC', newValue) // won't print unless 'immediate: true'
}
}
}
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2673">#c2673</a>)</em></sub></div>