/
githubmirror
/
ChatDev
Обзор
Документация
Войти
/
githubmirror
/
ChatDev
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
frontend/src/router/index.js
49 строк
1 KB
NINE
fix: Fix what the navigation hide interaction affects all pages
15 мар 2026, 08:49
15 мар 2026, 08:49
b8b3997
Код
Авторство
О чём код?
import { createRouter, createWebHistory } from 'vue-router' const routes = [ { path: '/', component: () => import('../pages/HomeView.vue') }, { path: '/tutorial', component: () => import('../pages/TutorialView.vue'), meta: { hideNavOnScroll: true } }, { path: '/launch', component: () => import('../pages/LaunchView.vue') }, { path: '/batch-run', component: () => import('../pages/BatchRunView.vue') }, { path: '/workflows/:name?', component: () => import('../pages/WorkflowWorkbench.vue') } ] const router = createRouter({ history: createWebHistory(), routes, scrollBehavior(to, from, savedPosition) { if (savedPosition) { return savedPosition } if (to.hash) { return { el: to.hash, behavior: 'smooth', // Add a small delay to ensure the element exists top: 0 } } // Otherwise scroll to top return { top: 0 } } }) export default router