【问题标题】:Vuetify Error - "Cannot read property of 'extend' of undefined"Vuetify 错误 - “无法读取未定义的‘扩展’属性”
【发布时间】:2020-07-12 13:31:49
【问题描述】:

安装 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/>'
})

非常感谢任何帮助

【问题讨论】:

  • 你为什么使用两个 ui 库?一个就够了
  • vuetify 中有一些我想使用的组件,但我熟悉用于一般设计的引导程序
  • 但这会产生一些冲突
  • 最终删除了 vuetify 并重新创建了我需要的组件

标签: javascript vue.js webpack vuetify.js


【解决方案1】:

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

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-09-02
相关资源
最近更新 更多