创建过程:
1.vue init webpack 项目名
创建模板太慢的话 npm config set registry http://registry.npm.taobao.org/
然后再vue init webpack 项目名
2.创建项目的时候不要选校验代码的那些配置了;
3.npm run dev 运行
4.npm i element-ui -S 安装 elementui
(element-ui 中文官网 https://element.eleme.cn/#/zh-CN)
router/index.js
Vue.use(Router);
//重复点击侧边栏菜单发现报错,添加这个。
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}