Li Kui
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
9 additions and
9 deletions
-
packages/effects/hooks/src/use-refresh.ts
-
packages/effects/hooks/src/use-tabs.ts
-
packages/effects/hooks/src/use-watermark.ts
-
packages/stores/src/modules/tabbar.ts
|
|
|
@ -6,8 +6,8 @@ export function useRefresh() { |
|
|
|
const router = useRouter(); |
|
|
|
const tabbarStore = useTabbarStore(); |
|
|
|
|
|
|
|
function refresh() { |
|
|
|
tabbarStore.refresh(router); |
|
|
|
async function refresh() { |
|
|
|
await tabbarStore.refresh(router); |
|
|
|
} |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
@ -44,7 +44,7 @@ export function useTabs() { |
|
|
|
} |
|
|
|
|
|
|
|
async function openTabInNewWindow(tab?: RouteLocationNormalized) { |
|
|
|
tabbarStore.openTabInNewWindow(tab || route); |
|
|
|
await tabbarStore.openTabInNewWindow(tab || route); |
|
|
|
} |
|
|
|
|
|
|
|
async function closeTabByKey(key: string) { |
|
|
|
|
|
|
|
@ -48,18 +48,18 @@ export function useWatermark() { |
|
|
|
}; |
|
|
|
watermark.value = new Watermark(cachedOptions.value); |
|
|
|
|
|
|
|
watermark.value?.create(); |
|
|
|
await watermark.value?.create(); |
|
|
|
} |
|
|
|
|
|
|
|
async function updateWatermark(options: Partial<WatermarkOptions>) { |
|
|
|
if (!watermark.value || !watermark.value?.check()) { |
|
|
|
await initWatermark(options); |
|
|
|
} else { |
|
|
|
if (watermark.value) { |
|
|
|
await nextTick(); |
|
|
|
watermark.value?.changeOptions({ |
|
|
|
await watermark.value?.changeOptions({ |
|
|
|
...cachedOptions.value, |
|
|
|
...options, |
|
|
|
}); |
|
|
|
} else { |
|
|
|
await initWatermark(options); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -349,7 +349,7 @@ export const useTabbarStore = defineStore('core-tabbar', { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async setUpdateTime() { |
|
|
|
setUpdateTime() { |
|
|
|
this.updateTime = Date.now(); |
|
|
|
}, |
|
|
|
/** |
|
|
|
|