When working with VueJs, I have found that I can easily access the data of the current route. However, I have encountered a situation where I need to access the data of a different route by its name. Let's say I have defined the following routes:
[
{
name: "dashboard",
path: "/",
component: Dashboard,
meta: {
title: "Dashboard",
}
},
{
name: "login",
path: "/login",
component: Login,
meta: {
title: "Login",
}
}
]
Now, if I am on the dashboard route, I know I can use this.$route
to access its data. But how can I access the meta data of the route named "login"? Is there a function that will return the object related to the route named login
?