Newer
Older
robot_dog_patrol_front / src / utils / keepQuery.ts
lyg on 4 Dec 470 bytes 全局主题修改
// 保存页面查询等参数
import useKeepAliveStore from '@/store/modules/keepAlive'

const keepAliveStore = useKeepAliveStore()
// 操作
const needKeep = ['detail']
export function keepSearchParams(to: any, componentName: string) {
  if (needKeep.some((item: string) => to.includes(item))) {
    keepAliveStore.add(componentName)
    console.log(keepAliveStore.list)
  }
  else {
    keepAliveStore.remove(componentName)
    console.log(keepAliveStore.list)
  }
}