Nuxt/test/fixtures/basic/pages/before-nuxt-render.vue
David Ovčačík 9f02e5dae7
feat(vue-app): context.beforeSerialize method (#9332)
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>
2021-06-04 16:21:16 +02:00

16 lines
277 B
Vue

<template>
<h1>Special state in `window.__NUXT__`</h1>
</template>
<script>
export default {
middleware ({ beforeNuxtRender }) {
if (process.server) {
beforeNuxtRender(({ nuxtState }) => {
nuxtState.beforeNuxtRender = true
})
}
}
}
</script>