feat: 更新 utils4u 依赖至 2.18.1,并添加 PrimeVue 服务的全局类型声明
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 1m11s
/ depcheck (push) Successful in 1m8s
/ playwright (push) Successful in 3m4s

This commit is contained in:
严浩
2024-12-19 13:11:42 +08:00
parent 6cd44c4b34
commit c9bde0b7da
8 changed files with 23 additions and 98 deletions

View File

@ -1,5 +1,4 @@
import { DataLoaderPlugin } from 'unplugin-vue-router/data-loaders';
import { createLogGuard, createProgressGuard, createStackGuard } from 'utils4u/vue-router';
import { createRouter, createWebHistory } from 'vue-router';
import { handleHotUpdate, routes } from 'vue-router/auto-routes';
@ -17,15 +16,16 @@ if ($__DEV__) Object.assign(window, { router });
function setupRouter(app: import('vue').App) {
app
// Register the plugin before the router
.use(DataLoaderPlugin, { router })
// adding the router will trigger the initial navigation
.use(router);
.use(DataLoaderPlugin, { router }) // Register the plugin before the router
.use(router); // adding the router will trigger the initial navigation
}
export { router, setupRouter };
// ========================================================================
// =========================== Router Guards ==============================
// ========================================================================
{
// 警告:路由守卫的创建顺序会影响执行流程,请勿调整
createProgressGuard(router);
createNProgressGuard(router);
createLogGuard(router);
Object.assign(window, { stack: createStackGuard(router) });
}
export { router, setupRouter };