Replies: 1 comment
-
忘记说了,也试过在grid上to方法,现象是一样的。都是无法跳转 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
构建了一个H5页面,van-tabbar作为页面底部,van-grid 构建了一些按钮。点击触发跳转:
const click = (path: string, name: string) => {
console.log('/' + path)
router.push({ path: '/' + path })
console.log(name, router.hasRoute(name))
}
打印出来的路由路径正确, router.hasRoute(name)为true,路由守卫里面打印to的信息:
{fullPath: "/staff/order/unfinished"hash: ""href: "/staff/order/unfinished"matched: Array(2)0: {path: '/staff/order/order', redirect: undefined, name: 'order', meta: {…}, aliasOf: undefined, …}aliasOf: undefinedbeforeEnter: undefinedchildren: Array(3)0: {path: '/staff/order/create', name: 'create', component: undefined, meta: {…}}1: {path: '/staff/order/unfinished', name: 'unfinished', meta: {…}, component: ƒ}2: {path: '/staff/order/finished', name: 'finished', meta: {…}, component: ƒ}length: 3[[Prototype]]: Array(0)components: {default: {…}}enterCallbacks: {}instances: {default: null}leaveGuards: Set(0) {size: 0}meta: {title: '订单', icon: 'list-switching'}name: "order"path: "/staff/order/order"props: {default: false}redirect: undefinedupdateGuards: Set(0) {size: 0}[[Prototype]]: Object1: aliasOf: undefinedbeforeEnter: undefinedchildren: []length: 0[[Prototype]]: Array(0)components: default: {__hmrId: 'a5b9b352', __file: '/opt/vscode/project/zlang_property/business_wechat/src/views/staff/order/unfinished.vue', render: ƒ}[[Prototype]]: ObjectenterCallbacks: {}instances: {default: Proxy(Object)}leaveGuards: Set(0) {size: 0}meta: {title: '未完订单', icon: 'notes-o'}name: "unfinished"path: "/staff/order/unfinished"props: {default: false}redirect: undefinedupdateGuards: Set(0) {size: 0}[[Prototype]]: Objectlength: 2[[Prototype]]: Array(0)meta: {title: '未完订单', icon: 'notes-o'}name: "unfinished"params: {}path: "/staff/order/unfinished"query: {}redirectedFrom: undefined[[Prototype]]: Object
使用的版本:
"vant": "^4.9.0",
"vue": "^3.4.21",
"vue-router": "^4.3.0",
"vite": "^5.2.8",
Beta Was this translation helpful? Give feedback.
All reactions