簡體   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