vue实现跳转接口push 转场动画示例
1.index.js配置子路由children。
importVuefrom'vue' importRouterfrom'vue-router' importSingerDetailfrom'components/singer-detail/singer-detail'
Vue.use(Router)
exportdefaultnewRouter({ routes:[ { path:'/', redirect:'/recommend' }, { path:'/singer', component:Singer, //配置子路由,加一个参数children children:[ { //:id以id为变量,传递一个参数,跳转到不同子路由 path:':id', component:SingerDetail } ] }, { path:'/search', component:Search, children:[ { path:':id', component:SingerDetail } ] } ] })
1.Singer
//需要用routeview承载子路由
2.listview(singer子组件)
3.singerDetail