我在一个Nuxt项目中使用vuetify有一个问题,我遵循了文档,告诉你只需要在你的项目中安装@nuxtjs/vuetify依赖项,并在nuxt.config.js文件的buildModules部分添加一行。组件运行正常,但我没有看到任何css样式,有什么问题吗?

这是我的nuxt.config.js文件
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'mounir-ssr-diabete',
htmlAttrs: {
lang: 'en',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/typescript
'@nuxt/typescript-build',
['@nuxtjs/vuetify', {}],
],
router: {},
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
[
'@nuxtjs/firebase',
{
config: {
apiKey: 'AIzaSyD_wgrl3S3RjpgwaEP2bDLpLDnIQz2C2Vc',
authDomain: 'mounir-ssr.firebaseapp.com',
projectId: 'mounir-ssr',
storageBucket: 'mounir-ssr.appspot.com',
messagingSenderId: '26338888590',
appId: '1:26338888590:web:be1893a374f3abc10cb2df',
measurementId: 'G-Y7YHDQDLM8',
},
services: {
auth: {
persistence: 'local', // default
initialize: {
onAuthStateChangedAction: 'onAuthStateChangedAction',
subscribeManually: false,
},
ssr: false,
},
},
},
],
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {},
}发布于 2021-04-28 19:17:48
您应该将vuetify主题信息与axios和build一起添加到nuxt.config.js文件中。像这样..。
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
"@nuxtjs/eslint-module",
"@nuxtjs/vuetify",
],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
"@nuxtjs/axios",
],
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {},
vuetify: {
customVariables: ["~/assets/variables.scss"],
theme: {
light: true,
themes: {
dark: {
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3,
},
},
},
},如果你不清楚,请问我。
https://stackoverflow.com/questions/67298040
复制相似问题