module.exports = {
presets: [
‘@vue/cli-plugin-babel/preset‘,
["@babel/preset-env", { "modules": false }]
],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}
import Vue from ‘vue‘
import App from ‘./App.vue‘
import ElementUI from ‘element-ui‘;
import ‘element-ui/lib/theme-chalk/index.css‘;
Vue.config.productionTip = false
Vue.use(ElementUI);
new Vue({
render: h => h(App),
}).$mount(‘#app‘)
import Vue from ‘vue‘;
import App from ‘./App.vue‘;
import { Button, Select } from ‘element-ui‘;
Vue.config.productionTip = false
Vue.component(Button.name, Button);
Vue.component(Select.name, Select);
/* 或写为
* Vue.use(Button)
* Vue.use(Select)
*/
new Vue({
el: ‘#app‘,
render: h => h(App)
});
原文:https://www.cnblogs.com/beiyi-Lin/p/15310392.html