我正在尝试获取(router.js中定义的当前路由名称和元) ,在布局组件或App.vue
中在router.js中
export default new Router({
routes: [
{
path: '/',
name: 'home',
meta: { layout: "default" },
component: () => import( './views/dashboard.vue')
},
]
我打算在App.vue中做什么,
created() {
console.log(this.$route );
console.log( this.$route.meta.layout);
console.log( this.$router.params);
console.log( this.$currentRoute);
},
似乎没有任何作用