Replies: 1 comment
-
You need to install @pinia/nuxt and then in nuxt config:
And for vuetify, create a plugins folder, with a vuetify.ts file and inside: import { createVuetify } from 'vuetify'
import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
export default defineNuxtPlugin(nuxtApp => {
const vuetify = createVuetify({
components,
directives,
})
nuxtApp.vueApp.use(vuetify)
}) But I'm having issues to render Vuetify's styles correctly so that's why I'm here in the discusion to find a solution :P... EditFixed the issue of the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I installed the pinia and vuetify3 and i got the message like that..
'''
[vite dev] Error loading external "fs".
at file:///C:/Users/ipactory_pc_006/Desktop/projects/test3/.nuxt/dist/server/server.mjs:3021:264
at async instantiateModule (file:///C:/Users/ipactory_pc_006/Desktop/projects/test3/.nuxt/dist/server/server.mjs:22994:3)
'''
i installed vuetify3 in this way,
https://github.com/nuxt/framework/discussions/1183
wobsoriano's comment
Import components
'''
// plugins/vuetify.ts
import { defineNuxtPlugin } from '#app'
import { createVuetify } from 'vuetify'
import {
VApp,
VAppBar,
VBtn
} from 'vuetify/components'
// Import everything
// import * as components from 'vuetify/components'
export default defineNuxtPlugin((nuxtApp) => {
const vuetify = createVuetify({
components: {
VApp,
VAppBar,
VBtn
}
})
nuxtApp.vueApp.use(vuetify)
})
'''
Transpile and add styles to nuxt.config.ts
'''
import { defineNuxtConfig } from 'nuxt3'
export default defineNuxtConfig({
css: ['vuetify/lib/styles/main.sass'],
build: {
transpile: ['vuetify']
}
})
'''
and i installed pinia in this way,
'''
yarn add pinia
'''
make directory "plugins" and make typescript file "pinia.ts" and
'''
import { createPinia } from "pinia";
import { defineNuxtPlugin } from "nuxt3";
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(createPinia());
});
'''
and error...
Please help me
Beta Was this translation helpful? Give feedback.
All reactions