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

138
Views
How to use variable for html attribute in vue?

I'm using vue-router and I want to create navigation bar like this.

//...
navs: [
   { title: 'Home', router: '/' },
   { title: 'Settings', router: '/settings' }
]

//...

<li v-for='nav in navs' :key="nav.title" class="nav">
   <router-link to='nav.router'>{{nav.title}}</router-link> //nav.router does not return as I expect
</li>

//...

But nav.router all navigate to /nav.router not / an /settings

Is there a way to fix this?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try to bind your routes:

:to='nav.router'
about 4 years ago · Juan Pablo Isaza Report
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!