yukinoshita_sakura
How to register global listener for window and add css variable with v-bind at nuxt pages/index
I am migrating my vue3 project to nuxt3, but I found that the main page at
pages/index.vue
is not the root page which also mounts when any page is active.
In my vue project, I use app.vue
to add dynamic css variable with v-bind
and classes uses them and add global onresize eventHandler to window.
So how can I let them run globally in nuxt as they did in my vue project? My vue solution is below.
6 replies