下载 : npm i element-ui -S
按需引入要下载 babel-plugin-component
下载: npm install babel-plugin-component -D
修改 babel.config.js 文件
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
}
然后在main.js中引入
使用:<el-button>默认按钮</el-button>