-
-
Notifications
You must be signed in to change notification settings - Fork 130
Closed
Description
Description
SFC custom block and JSX/TSX YAML format comments are not perfect method to custom route data, especially when I want to use imported data in route data:
import { mdiHomeOutline } from '@mdi/js';
const route = {
meta: {
btnProps: {
tip: 'home',
icon: mdiHomeOutline,
order: 2,
hideOn: 'mobile',
},
},
}Suggested solution
custom route data in runtime code is maybe better method, it has natural framework-independence advantage, and support type check:
// src/pages/index.tsx
import type { RouteMeta } from 'vue-router';
import { mdiHomeOutline } from '@mdi/js';
export const route = {
meta: {
btnProps: {
tip: 'home',
icon: mdiHomeOutline,
order: 2,
hideOn: 'mobile',
} satisfies RouteMeta,
},
}
export default ...Alternative
No response
Additional context
No response
Validations
- Follow the Code of Conduct
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels