Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
javascript - concat a string to a variable

I have the following in a vue.js script:

<v-tab v-for="type in searchTypes" :id="type.value" :key="type.value" @click="getSelectValue(type.value)">

I want to append the id of "type.value" with a fixed string "_tab"

I have tried various ways without getting it to work. Any help is appreciated. thank you

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

You can use javascript expressions to contat the string like this:

<v-tab v-for="type in searchTypes" :id="type.value + '_tab'" :key="type.value" @click="getSelectValue(type.value)">

I hope this can help you here is the source:

Using JavaScript Expressions

about 4 years ago · Juan Pablo Isaza Relatório

0

You can use template literal syntax to do that. I'm a React guy, but I think this will work. Hopefully I understood the question correctly.

<v-tab v-for="type in searchTypes" :id="`_tab${type.value}`" :key="type.value" @click="getSelectValue(type.value)">
about 4 years ago · Juan Pablo Isaza Relatório

0

Just use string interpolation:

<v-tab v-for="type in searchTypes" :id="`${type.value}_tab`" :key="type.value" @click="getSelectValue(type.value)">

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda