I want to take only matched meta from the vue-router Route type.
Specifically, I was able to take out the matched as below, but I don't know how to take out only meta and get an error.
I would appreciate it if you could tell me how to resolve it.
const to:Pick<Route, 'fullPath' | 'path' | 'matched' > = {
fullPath: '/home',
path: '/home',
matched: [{meta:{isPublic:true}},
};
Type '{meta:{isPublic:true;};} 'is missing the following properties from type 'RouteRecord': path, regex, components, instances, propsts (2739)
type Meta=Route ['matched'] [number] ['meta']
It can be taken out by .
However, this type has been exported in the first place, so
import type {RouteMeta} from 'vue-router'
There's a good enough explanation.
© 2024 OneMinuteCode. All rights reserved.