繁体   English   中英

Vuetify 错误-“无法读取未定义的‘扩展’属性”

[英]Vuetify Error - "Cannot read property of 'extend' of undefined"

安装 Vuetify 后,我目前收到以下控制台错误。 我正在使用 webpack v3.6

Uncaught TypeError: Cannot read property 'extend' of undefined
    at Module../src/mixins/themeable/index.ts (index.ts:21)
    at __webpack_require__ (bootstrap:19)
    at Module../src/components/VApp/VApp.ts (vuetify.js:391)
    at __webpack_require__ (bootstrap:19)
    at Module../src/components/VApp/index.ts (index.ts:1)
    at __webpack_require__ (bootstrap:19)
    at Module../src/components/index.ts (index.ts:1)
    at __webpack_require__ (bootstrap:19)
    at Module../src/index.ts (vuetify.js:32032)
    at __webpack_require__ (bootstrap:19)
./src/mixins/themeable/index.ts @ index.ts:21
__webpack_require__ @ bootstrap:19
./src/components/VApp/VApp.ts @ vuetify.js:391
__webpack_require__ @ bootstrap:19
./src/components/VApp/index.ts @ index.ts:1
__webpack_require__ @ bootstrap:19
./src/components/index.ts @ index.ts:1
__webpack_require__ @ bootstrap:19
./src/index.ts @ vuetify.js:32032
__webpack_require__ @ bootstrap:19
(anonymous) @ bootstrap:83
(anonymous) @ bootstrap:83
webpackUniversalModuleDefinition @ universalModuleDefinition:9
(anonymous) @ universalModuleDefinition:10

有没有人经历过类似的事情? 我已经将 vuetify 作为这样的插件包含在内:

// src/plugins/vuetify.js

import Vue from 'vue'
import Vuetify from 'vuetify'
import 'vuetify/dist/vuetify.min.css'

Vue.use(Vuetify)

const opts = {}

export default new Vuetify(opts)

然后将其导入到我的 main.js 文件中

import Vue from 'vue'
import App from './App'

import router from './router'
import { store } from './store/store'

import BootstrapVue from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'

import vuetify from '@/plugins/vuetify'

Vue.use(BootstrapVue)

Vue.config.productionTip = true

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  vuetify,
  components: { App },
  template: '<App/>'
})

任何帮助深表感谢

在将 vuetify ^2.5.1 添加到现有项目后,我得到了完全相同的错误,才意识到我使用的是 vue ^3.0.0。 不幸的是,vuetify 不支持 Vue 3.0(但……截至 2021 年 5 月)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM