Home > Software engineering >  How can i concat a variable with a string in vuejs template?
How can i concat a variable with a string in vuejs template?

Time:12-10

I need to concat a string with the value of my variable i was trying this:

<el-tab-pane label="price {{cars.value}}"

but i am getting "price {{cars.value}}"

i want to show like this:

"price 3"

CodePudding user response:

You can do that by using v-bind. And you don't need to use it .value in the template as VUE does that automatically for you. Try using like following:

<el-tab-pane v-bind:label="'price '  cars"

For reference: https://v3.vuejs.org/api/directives.html#v-bind

  • Related