-
npm i element-ui -S -
npm install babel-plugin-component -D -
// babel.config.js文件中配置 plugins: [ [ “component”, { “libraryName”: “element-ui”, “styleLibraryName”: “theme-chalk” } ] ] -
// 在项目 src>boot文件夹下新建element.js文件 import Vue from ‘vue’; import 'element-ui/lib/theme-chalk/index.css'; import { Button } from ‘element-ui’; Vue.use(Button) -
在quasar.config.js文件中,boot节点数组中新增字符串 'element'
在quasar cli创建的vue项目中按需引入ElementUI
最新推荐文章于 2024-07-30 10:52:50 发布
该文章详细介绍了如何将Element-UI库引入到Vue项目中,包括使用npm安装babel-plugin-component,配置babel.config.js,创建element.js文件导入并使用Element-UI的Button组件,以及在quasar.config.js中设置boot文件夹的加载顺序。
2062

被折叠的 条评论
为什么被折叠?



