-1👍
If you want to pass data from server-side to client-side you should use useState
// plugins/foo.server.ts
export const useFoo = () => useState('foo', () => 'bar')
export default defineNuxtPlugin((nuxtApp) => {
const foo = useFoo();
})
// useFoo composable
const foo = useState('foo');
console.log(foo.value) // 'bar'
more in docs https://nuxt.com/docs/getting-started/state-management
- [Vuejs]-ERROR in renderer.js from UglifyJs Unexpected token punc «(»
- [Vuejs]-Vue2: Reacting on non existing input elements
Source:stackexchange.com