?1:安裝 vue-router
??cnpm install vue-router --save次
2:在index.js文件中引用
import Router from 'vie-router'
3:使用
Vue.use(Router);
4:在index.js文件中配置映射
?
5:在組建中
name與routes中的name一樣,params:跳轉(zhuǎn)頁(yè)面?zhèn)鬟f參數(shù),tag:映射的標(biāo)簽<div>,也可以是其它標(biāo)簽<li>
6:點(diǎn)擊router-link用法跳轉(zhuǎn),
在跳轉(zhuǎn)各面 $route.params.username可以獲取改值
?