mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-25 22:30:19 +08:00
fix(projects): 修复页面缓存
This commit is contained in:
22
src/hooks/common/useRouteProps.ts
Normal file
22
src/hooks/common/useRouteProps.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
export default function useRouteProps() {
|
||||
const route = useRoute();
|
||||
const props = computed(() => {
|
||||
/** 路由名称 */
|
||||
const name = route.name as string;
|
||||
/** 混存页面 */
|
||||
const keepAlive = Boolean(route.meta?.keepAlive);
|
||||
/** 视高100% */
|
||||
const fullPage = Boolean(route.meta?.fullPage);
|
||||
|
||||
return {
|
||||
name,
|
||||
keepAlive,
|
||||
fullPage
|
||||
};
|
||||
});
|
||||
|
||||
return props;
|
||||
}
|
||||
Reference in New Issue
Block a user