feat: 重构插件安装方式,统一使用 install 方法并移除不必要的 setup 函数
This commit is contained in:
@ -14,14 +14,14 @@ router.onError((error) => {
|
||||
console.debug('🚨 [router error]: ', error);
|
||||
});
|
||||
|
||||
function setupRouter(app: import('vue').App) {
|
||||
export { router };
|
||||
export function install({ app }: { app: import('vue').App<Element> }) {
|
||||
app
|
||||
// Register the plugin before the router
|
||||
.use(DataLoaderPlugin, { router })
|
||||
// adding the router will trigger the initial navigation
|
||||
.use(router);
|
||||
}
|
||||
export { router, setupRouter };
|
||||
// ========================================================================
|
||||
// =========================== Router Guards ==============================
|
||||
// ========================================================================
|
||||
|
Reference in New Issue
Block a user