mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
19 lines
423 B
JavaScript
19 lines
423 B
JavaScript
import { reactive, ref } from 'vue';
|
|
import { useRoute } from '@@/core/coreExports';
|
|
|
|
const cache = reactive(new Map());
|
|
|
|
export const getTitle = (path) => cache.get(path);
|
|
|
|
export const deleteTitle = (patch) => cache.delete(patch);
|
|
|
|
export const useTabTitle = (title) => {
|
|
const route = useRoute();
|
|
const titleRef = ref(title);
|
|
const path = route.path;
|
|
|
|
cache.set(path, titleRef);
|
|
|
|
return titleRef;
|
|
};
|