vue路由配置
1.首先在项目中安装vue-router
在terminal中输入 npm install vue-router —save
2.在mian.js中导入router
import router from ‘./router’
3.在components下新建vue页面 test.vue
4.在router下的index.js 导入路由
import test from '../componets/test'
export default new Router({
routes: [
{
path: ‘/test’,
name: ‘test’,
component: test
}]
5.在app.vue页面
页面展示用
还没有评论,来说两句吧...