question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set $route meta data dynamically.

See original GitHub issue

What problem does this feature solve?

For SEO / Layout purpose good to have $route.setMeta method to update current route’s meta information because if we view an artical, I’ll fetch artical title using route param first, then We can set the page title.

please advice me.

What does the proposed API look like?

To update current route meta data

this.$route.setMeta({
    title: "Example title from service."
})

Then we can have separete hook for route modifed like

router.onUpdate((route) => {
    // do something here
    document.title = route.meta.title;
})

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

22reactions
posvacommented, Jan 22, 2020
0reactions
JustineMikocommented, Jun 14, 2022

Hi @fuoridallarete, Did you find a solution for this issue about making your breadcrumb title dynamic inside metafields ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue Router Dynamically set Meta - Stack Overflow
I used this great idea for route permissions. I set a function to a meta.permission prop for a named route and then call...
Read more >
Route Meta Fields | Vue Router
First, each route object in the routes configuration is called a route record. Route records may be nested. Therefore when a route is...
Read more >
Dynamic Meta Tags in Angular - TekTutorialsHub
In this tutorial, we learn how to add Dynamic Meta Tags in Angular. First, we will define the Meta Tags in the Angular...
Read more >
Dynamically Setting Meta Tags in Remix - Sabin Adams
Setting Dynamic Metadata ... To set up our metadata, we can export a meta function from our route that Remix will use to...
Read more >
Simple Dynamic Pages Meta Titles On VueJS | Tony Swierz
routes : [ { path: '/', name: 'home', component: Home, meta: { title: 'Welcome' } },. In that way the tab title of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found