Closed rudolfbyker closed 1 year ago
Until the owner updates this package, I suggest you use the traditional import method, in this example i'm also need to use v-data-table
plugin/vuetify.js
file:
import { createVuetify } from "vuetify"
import * as components from "vuetify/components"
import { VDataTable } from "vuetify/labs/VDataTable"
import * as directives from "vuetify/directives"
export default defineNuxtPlugin((nuxtApp) => { const vuetify = createVuetify({ components: { ...components, VDataTable, }, directives, })
nuxtApp.vueApp.use(vuetify) })
2. update `nuxt.config.js`
```js
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
css: [
"vuetify/lib/styles/main.sass",
"@mdi/font/css/materialdesignicons.min.css",
],
build: {
transpile: ["vuetify"],
},
vite: {
define: {
"process.env.DEBUG": false,
},
},
})
Included in latest version. Please reopen if you encounter any issues
i am still having some troubles with labs component.
How can i use them, i alredy have
useVuetifyLabs: true
I am using 0.3.0
vuetify: {
/* vuetify options */
vuetifyOptions: {
blueprint: md3,
components: {
...components,
...labsComponents,
},
// @TODO: list all vuetify options
},
moduleOptions: {
/* nuxt-vuetify module options */
treeshaking: true,
useIconCDN: true,
/* vite-plugin-vuetify options */
styles: "sass",
autoImport: true,
useVuetifyLabs: true,
},
},
I get this errors:
Unexpected token '.' 12:51:37 PM
.v-application { ^
SyntaxError: Unexpected token '.'
same.
same.
so i found out what you need to change in order to be able to use Vuetify Labs Components.
In the Documentation i found that if useVuetifyLabs is set to true, treeshaking should be disabled otherwise it will not work.
You actually do not need to specify the components.. (i mean it does not work for me if i specify them).
Thank you, gave a try same pb :
[Vue warn]: Failed to resolve component: v-skeleton-loader 9:16:18 AM
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.
when trying like this :
import { VSkeletonLoader } from "vuetify/labs/VSkeletonLoader";
...
vuetify: {
vuetifyOptions: {
icons: {
defaultSet: 'mdi',
},
theme: {
defaultTheme: 'light',
},
components: {
VSkeletonLoader,
},
},
moduleOptions: {
treeshaking: false,
useIconCDN: true,
styles: 'sass',
autoImport: true,
useVuetifyLabs: true,
}
},
i get
ERROR Cannot restart nuxt: Unexpected token '.' 9:17:43 AM
.v-skeleton-loader {
^
SyntaxError: Unexpected token '.'
Maybe i will remove that plugin and go with regular vuetify installation..
Contact Details
rudolfbyker@gmail.com
What happened?
Summary
When I try to import
VSkeletonLoader
in order to make it available as a component, like this …… I get an error like this during
nuxt prepare
:This happens on the line where
VSkeletonLoader
tries to import CSS:import "./VSkeletonLoader.css";
Steps to reproduce
Version
1.0.2 (Default)
What browsers are you seeing the problem on?
No response
Relevant log output
Additional context
I'm trying to migrate a working Vite+Vuetify3+Vue3 app to Nuxt3.