【发布时间】:2021-09-01 05:09:26
【问题描述】:
我正在使用 vue 3 设置,我想访问我使用的全局变量 vuetify。 我可以在 config.globalVariable 中看到它,但我无法在设置中使用它。
{_uid: 0, _component: {…}, _props: null, _container: div#app, _context: {…}, …}
component: ƒ component(name, component)
config: Object
compilerOptions: (...)
errorHandler: undefined
globalProperties:
$vuetify: {defaults: {…}}
$messageSystem: {addMessage: ƒ}
__proto__: Object
isNativeTag: (tag) => {…}
...
如您所见,我看到了 $vuetify,但在设置中我无法访问它。
setup() {
...
this.$vuetify.theme.dark = true;
...
这是我访问全局变量的方式吗?
我得到的错误:
Cannot read property '$vuetify' of undefined
【问题讨论】:
标签: vue.js vuetify.js vuejs3 vue-composition-api vuetifyjs3