vue 脚手架关于路由的一点理解

https://router.vuejs.org/zh/ 可以先翻翻文档看看介绍啊,一般我不怎么喜欢看文档,都是直接看人家案例,在回头看文档的,所以学习速度慢很多,希望我以后成为一个爱学习的妹子,比较朝这个方向努力了N年。

我理解的路由就是你那边组件用到路由,就在路由route.js上面配置

route.js配置

import Vue from 'vue'
import Router from 'vue‐router'
import index from '@/pages/home/index.vue'   //那些组件用到的
import list from '@/pages/list/list.vue'
import city from '@/pages/city/city.vue'
Vue.use(Router)
export default new Router({
 

routes: [
{
path: '/',
name: 'index',
component: index
},
{
path: '/list',
name: 'list',
component: list
},
{
path: '/city',
name: 'city',
component: city
}
]

})

 

------------还没有完结,明天再继续吧--------------------

 

posted @ 2019-04-18 18:08  阳光透过幸福  阅读(463)  评论(0编辑  收藏  举报