.babelrc配制如下
{
"presets": [
["es2015", { "modules": false }]
],
"plugins": [
["component", [{
"libraryName": "element-ui",
"styleLibraryName": "theme-default"
}]]
]
}
webpack配制如下
{
test: /.js$/,
use: ['babel-loader'],
exclude: /node_modules/
},
引入时的代码
import Vue from 'vue'
import ResetCss from '../../assets/reset.css'
import FontCss from '../../assets/font.css'
// 完整引ele
import { Button, Card, Form, Input, Checkbox, FormItem } from 'element-ui'
import App from './App.vue'
// 加载ele插件
Vue.use(Button)
Vue.use(Card)
Vue.use(Form)
Vue.use(Input)
Vue.use(Checkbox)
Vue.use(FormItem)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…