我在使用新的 vuetify 3 定义主题设置时遇到一些麻烦。
文档示例(针对 Vuetify3):
// src/plugins/vuetify.js
import { createApp } from 'vue'
import { createVuetify } from 'vuetify'
export default createVuetify({
theme: {
defaultTheme: 'myCustomTheme',
themes: {
myCustomTheme: {
dark: false,
colors: {
..., // We have omitted the standard color properties here to emphasize the custom one that we've added
green: '#00ff00'
}
}
}
}
})
Run Code Online (Sandbox Code Playgroud)
我做了完全相同的事情(当然删除了...,颜色),但在 chrome 控制台中出现错误:
未捕获的类型错误:无法将未定义或 null 转换为对象
有谁知道为什么会发生这种情况?(我知道这是一个新版本,文档仍在开发中)。
谢谢!