大神我是哪里写错了吗
还有个问题 命名路由 怎么用 按文档写点击没反应阿
还有个问题 命名路由 怎么用 按文档写点击没反应阿
hhyang - 如有问题,请添加QQ1606726660 备注付费咨询
你有配置路由么?测试工程
完整的路由配置示例 请参照useRouter.js
import Vue from 'vue'
import Router from 'uni-simple-router';
Vue.use(Router);
const router = new Router({
routes: [{
path: "/pages/tabbar/tabbar-1/tabbar-1",
name: 'tabbar-1'
},
{
path: "/pages/tabbar/tabbar-2/tabbar-2",
name: 'tabbar-2'
},
{
path: "/pages/tabbar/tabbar-3/tabbar-3",
name: 'tabbar-3'
},
{
path: "/pages/tabbar/tabbar-4/tabbar-4",
name: 'tabbar-4',
other:{
H5Name:''
},
beforeEnter:(to,from,next)=>{
to.other.H5Name=to.query.name
next();
}
},
{
path: "/pages/tabbar/tabbar-5/tabbar-5",
name: 'tabbar-5'
},
{
path: "/pages/router/router1/router1",
name: 'router1'
}, {
path: "/pages/router/router2/router2",
name: 'router2',
beforeEnter:(to,from,next)=>{
next({name:'router3',params:{msg:'我是从router2路由拦截过来的'}});
}
}, {
path: "/pages/router/router3/router3",
name: 'router3',
beforeEnter:(to,from,next)=>{
next();
}
}, {
path: "/pages/router/router4/router4",
name: 'router4'
},
{
path: "/pages/router/router5/router5",
name: 'router5'
}
]
});
router.beforeEach((to, from, next) => {
next();
})
router.afterEach((to, from) => {
console.log(from)
})
export default router
hhyang - 如有问题,请添加QQ1606726660 备注付费咨询
这个是昨天在修复子组件时没测试全面而遗留下的bug 1.0.4已经修复 可以通过安装新版来解决此问题
npm install uni-simple-router@1.0.4