mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 16:46:19 +08:00
fix: fix missing page refresh parameters
This commit is contained in:
@@ -90,15 +90,25 @@ export function useTabs() {
|
||||
closeOther: () => canIUseFn() && closeOther(tabStore.getCurrentTab),
|
||||
closeCurrent: () => canIUseFn() && closeCurrent(tabStore.getCurrentTab),
|
||||
resetCache: () => canIUseFn() && resetCache(),
|
||||
addTab: (path: PageEnum, goTo = false, replace = false) => {
|
||||
addTab: (
|
||||
path: PageEnum | string,
|
||||
goTo = false,
|
||||
opt?: { replace?: boolean; query?: any; params?: any }
|
||||
) => {
|
||||
const to = getTo(path);
|
||||
|
||||
if (!to) return;
|
||||
useTimeout(() => {
|
||||
tabStore.addTabByPathAction();
|
||||
}, 0);
|
||||
const { replace, query = {}, params = {} } = opt || {};
|
||||
activeKeyRef.value = path;
|
||||
goTo && replace ? router.replace : router.push(path);
|
||||
const data = {
|
||||
path,
|
||||
query,
|
||||
params,
|
||||
};
|
||||
goTo && replace ? router.replace(data) : router.push(data);
|
||||
},
|
||||
activeKeyRef,
|
||||
};
|
||||
|
Reference in New Issue
Block a user