vue + element ui搭建前端项目
1、本机已有node和npm环境;
2、命令行执行命令:npm install -g 全局安装vue-cli脚手架;
3、进入常用放项目文件夹的project目录下执行:vue create xwq-frontend创建一个新项目,然后配置相关插件;
引入element ui:
1、执行以下三条命令:yarn add style-loader -d;
yarn add css-loader -d;
yarn add file-loader -d;
2、执行以下命令添加element ui:yarn add element-ui -save
3、在main.ts文件中加入:import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
4、添加bable-plugin-component依赖:yarn add babel-plugin-component -D
5、在babel.config.js中module.exports中加入:
plugins: [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
完成以上五步后
posted on 2021-04-12 15:07 哥撸的不是代码是刚子 阅读(369) 评论(0) 编辑 收藏 举报