You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
392 B

7 months ago
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 };
}