This commit is contained in:
xuziqiang
2024-05-15 17:29:42 +08:00
commit d0155dbe3c
7296 changed files with 1832517 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { useRoute } from 'vue-router';
import { computed } from 'vue';
export function useRouteConfig(props: Recordable = {}) {
const route = useRoute();
function getMeta(key?: string) {
if (key) {
return route.meta[key];
}
return route.meta;
}
const getTitle = computed(() => {
return getMeta('title') || props.title;
});
return { getMeta, getTitle };
}