[Vuejs]-Use dynamic variable in route tag vue 3

0👍

To use a variable in the pageTitle of your breadcrumb, you can use Vue’s string interpolation syntax, which allows you to embed expressions within a string by wrapping them in curly braces {}. In your case, you can replace the static page title with a dynamic one based on the route.params.slug value, like this:

<route>
{
  name: "educations-view-id-tab", 
  meta: {
    pageTitle: `Educations - ${route.params.slug}`, // dynamic page title using string interpolation
    breadcrumb: [
      {
        title: 'List',
        to:{ name: 'educations' },
        disabled:false
      },
      {
        title: 'View',
        disabled:true
      },
    ],
  }
}
</route>

Leave a comment