Vue JS and appending a variable to end of a URL

前端 未结 1 326
暖寄归人
暖寄归人 2021-01-25 02:45

I have a v-for method on my page and I\'m outputting a series of numbers.

1234
122356
124
12312

My v-for outputs each of these numbers and I ne

相关标签:
1条回答
  • 2021-01-25 03:07

    you should use the v-bind directive for this case, like following:

    <a v-bind:href="'/order/' + order.number">1234</a>
    <a v-bind:href="'/order/' + order.number">122356</a>
    <a v-bind:href="'/order/' + order.number">124</a>
    <a v-bind:href="'/order/' + order.number">12312</a>
    

    or in short you can write following as well:

    <a :href="'/order/' + order.number">1234</a>
    <a :href="'/order/' + order.number">122356</a>
    <a :href="'/order/' + order.number">124</a>
    <a :href="'/order/' + order.number">12312</a>
    
    0 讨论(0)
提交回复
热议问题