1.创建 ten 项目
vue init webpack ten
创建过程中出现以下内容
? Project name ten //空格
? Project description A Vue.js project //空格
? Author symiac <EC_Base@symiac> //空格
? Vue build standalone //空格
? Install vue-router? Yes //输入y
? Use ESLint to lint your code? No //输入n
? Set up unit tests No //输入n
? Setup e2e tests with Nightwatch? No //输入n
? Should we run `npm install` for you after the project has been created? (recom
mended) npm //空格
2.进入ten
cd ten
3.运行
npm run dev
4.引入element
npm i element-ui -S
npm install babel-plugin-component -D
5.修改.babelre文件
//原属性
"plugins": [
"transform-vue-jsx",
"transform-runtime",
]
//修改为
"plugins": [
"transform-vue-jsx",
"transform-runtime",
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
]
6.修改main.js文件 原文件中添加