路由参数问题

main
许宏杰 2 months ago
parent 59f63b35cb
commit 7683817dee

@ -14,11 +14,15 @@ export const LoginRoute: RouteRecordRaw = {
children: [ children: [
{ {
path: '/chat', path: '/chat',
redirect: `/chat/${Date.now()}` // 重定向到带默认ID的路径
},
{
path: '/chat/:id',
name: 'chat', name: 'chat',
component: () => import('@/views/AI/chat/index.vue') component: () => import('@/views/AI/chat/index.vue')
}, },
{ {
path: '/board', path: '/board/:id',
name: 'board', name: 'board',
component: () => import('@/views/chart/index.vue') component: () => import('@/views/chart/index.vue')
} }

@ -44,11 +44,10 @@ const menuList = [
] ]
const getCurrentRoute = path => { const getCurrentRoute = path => {
console.log(route.path, path, 'SSS') return route.path.includes(path)
return route.path == path
} }
const handlerPath = (path)=>{ const handlerPath = (path)=>{
router.push({path:path,query:{id:Date.now()}}) router.push(path + '/'+ Date.now())
} }
</script> </script>

Loading…
Cancel
Save