diff --git a/src/App.vue b/src/App.vue index 3508930..523772e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -32,17 +32,23 @@ export default defineComponent({ } // 默认主题色 this.setCssVar("primary", this.$profile.primaryColor); + // 进入插件 utools.onPluginEnter((enter) => { // 暗黑模式 this.$q.dark.set(utools.isDarkColors()); // 路由跳转 quickcommand.enterData = enter; - this.$router.push({ - path: enter.code, - query: { - timestamp: new Date().getTime(), - }, - }); + this.$router.push(enter.code); + }); + // 退出插件 + utools.onPluginOut(() => { + // 切到空路由 + this.$router.push("loading"); + // 保存偏好 + this.$utools.putDB( + _.cloneDeep(this.$profile), + this.$utools.DBPRE.CFG + "preferences" + ); }); }, }, diff --git a/src/pages/LoadingPage.vue b/src/pages/LoadingPage.vue new file mode 100644 index 0000000..4e7218d --- /dev/null +++ b/src/pages/LoadingPage.vue @@ -0,0 +1,5 @@ + diff --git a/src/router/routes.js b/src/router/routes.js index 3b4491f..98438dd 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -1,31 +1,41 @@ -const routes = [ - { +const routes = [{ path: '/configuration', - component: () => import('pages/ConfigurationPage.vue') + component: () => + import ('pages/ConfigurationPage.vue') }, { path: '/code', - component: () => import('pages/RunCodePage.vue') + component: () => + import ('pages/RunCodePage.vue') }, { path: '/newcommand', - component: () => import('pages/NewCommand.vue') + component: () => + import ('pages/NewCommand.vue') }, { path: '/:type(default|files|key|regex|window|professional)_:uid(\\w+)', - component: () => import('pages/CommandPage.vue') + component: () => + import ('pages/CommandPage.vue') }, { path: '/panel_:tags(\\w+)', - component: () => import('pages/ConfigurationPage.vue') + component: () => + import ('pages/ConfigurationPage.vue') }, { path: '/needupdate', name: 'needupdate', props: true, - component: () => import('pages/updateWarningPage.vue') + component: () => + import ('pages/updateWarningPage.vue') + }, + { + path: '/loading', + component: () => + import ('pages/LoadingPage.vue') } ] -export default routes +export default routes \ No newline at end of file