Open chenkunlia opened 6 years ago
在main.js文件中引入element ui,配置如下: import Vue from 'vue' import App from './App' // import VueRouter from 'vue-router' import router from './router/admin' // import router from './router' import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' Vue.config.productionTip = false // Vue.use(VueRouter) // Vue.use(ElementUI) Vue.use(ElementUI, { size: 'medium' // set element-ui default size // i18n: (key, value) => i18n.t(key, value) }) // const router = new VueRouter({admin}) / eslint-disable no-new / new Vue({ el: '#app', router, components: { App }, template: '' }) 报错信息如下: This dependency was not found:
解决方法: 1、复制文件element-ui/lib/theme-chalk/index.css 到element-ui/lib/style.css 2、复制文件夹element-ui/lib/theme-chalk/fonts 到element-ui/lib/fonts 3、重新编译解决问题 原因可能是更新新版本时把相关文件漏提交了
在main.js文件中引入element ui,配置如下: import Vue from 'vue' import App from './App' // import VueRouter from 'vue-router' import router from './router/admin' // import router from './router' import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/index.css' Vue.config.productionTip = false // Vue.use(VueRouter) // Vue.use(ElementUI) Vue.use(ElementUI, { size: 'medium' // set element-ui default size // i18n: (key, value) => i18n.t(key, value) }) // const router = new VueRouter({admin}) / eslint-disable no-new / new Vue({ el: '#app', router, components: { App }, template: ' '
})
报错信息如下:
This dependency was not found: