Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
Vue 3 set value to router meta

I have some problems with Vue 3 meta tags. The problem is, when I want to set value to router, it's loading setup twice, and sending all requests and everything in setup() double.

So I have router defined like this:

 {
        path: '/product/:id',
        name: 'products',
        component: () => import('@/components/layouts/layout.vue'),
        children: [
          {
            path: '',
            name: 'product.details',
            meta: {
              title: "My website",
              layout: 'default',
              requiredAuth: false,
              breadcrumbs: ref("")
            },
            props: (route: any) => ({
              id:  parseInt(route.params.id),
            }),
            component: () => import('@/components/views/ProductDetailsPage.vue'),
          }
}

So In ProductDetailsPage.VUE I have useRoute function and assigning breadcrumbs value, and it looks like so:

setup() {
  const route = useRoute();
  route.meta.breadcrumbs.value = 'test'
}

Sorry, I can't share full code here, but the problem is clearly from this line of code. When I remove route.meta.breadcrumbs.value = 'test' it's working fine, but I need to set this breadcrumbs.

Anyone had similar problems? Am I doing something wrong here?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!