一、把elementUI下载进Vue工程
1用cmd创建cuecli工程
2用编辑器打开vue工程后再终端输入npm i element-ui -S
下载element依赖
3部署依赖:打开main.js,再其中添加import ElementUI from 'element-ui'; import 'element-ui/lib/theme-chalk/index.css';Vue.use(ElementUI);
三行
二、引入一个新路由组件
1在主页面下<a href="#/newcomponent">xxxxx</a>
2在components文件夹下新建NewComoponent.Vue
3在router文件夹下index.js中引用import NewComoponent from '../components/NewComoponent'
并在下面的router实例中zhuce,新增一行{path:'/NewComoponent',component:NewComoponent},