feat: 更新 utils4u 依赖至 2.18.1,并添加 PrimeVue 服务的全局类型声明
This commit is contained in:
@ -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 };
|
||||
|
Reference in New Issue
Block a user