fix(router-plugin): 修复热更新处理逻辑的位置
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 2m29s
CI/CD Pipeline / playwright (push) Successful in 3m57s

This commit is contained in:
严浩
2025-10-21 10:04:39 +08:00
parent a324856c78
commit cf48052b82

View File

@@ -13,7 +13,7 @@ const router = createRouter({
},
strict: true,
});
if (import.meta.hot) handleHotUpdate(router);
if (__DEV__) Object.assign(globalThis, { router });
router.onError((error) => {
console.debug('🚨 [router error]:', error);
@@ -56,3 +56,6 @@ declare module 'vue-router' {
}
export { createGetRoutes } from 'virtual:meta-layouts';
// This will update routes at runtime without reloading the page
if (import.meta.hot) handleHotUpdate(router);