ray-template/src/store/hooks/useKeepAliveStore.ts
2024-10-20 01:15:12 +08:00

25 lines
497 B
TypeScript

import { piniaKeepAliveStore } from '../index'
export const useKeepAliveGetters = () => {
const variable = piniaKeepAliveStore()
/**
*
* @remark 获取当前可缓存项 name
*/
const getKeepAliveInclude = computed(() => variable.keepAliveInclude)
return {
getKeepAliveInclude,
}
}
export const useKeepAliveActions = () => {
const { setKeepAliveInclude, getKeepAliveInclude } = piniaKeepAliveStore()
return {
setKeepAliveInclude,
getKeepAliveInclude,
}
}