mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 10:04:05 +00:00
9f02e5dae7
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com> Co-authored-by: Daniel Roe <daniel@roe.dev> Co-authored-by: pooya parsa <pyapar@gmail.com>
27 lines
461 B
Vue
27 lines
461 B
Vue
<template>
|
|
<div>
|
|
<h1>Special state in `window.__NUXT__`</h1>
|
|
<client-only><pre>{{ nuxtState }}</pre></client-only>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data () {
|
|
return {
|
|
nuxtState: null
|
|
}
|
|
},
|
|
fetch () {
|
|
if (process.server) {
|
|
this.$root.context.beforeSerialize((nuxtState) => {
|
|
nuxtState.beforeSerialize = true
|
|
})
|
|
}
|
|
},
|
|
beforeMount () {
|
|
this.nuxtState = window.__NUXT__
|
|
}
|
|
}
|
|
</script>
|