in v-for you cannot use this.type to get data()
you should use a custom property to bind your data() in list item

data() {
    return {
        type: 'institution',
    }
},
<tbody>
    <tr v-for="(item) in participantData"
        type="this.type"
        :key="item.name">
        <td class="text-green-700 font-bold">
          <router-link :to=`/profile/${type}/${item.id}`>{{ item.name }}</router-link>
        </td>
        <td class="">{{ (item.totalEfficacy*100).toFixed(0) }} %</td>
        <td>{{ item.participation }}</td>
    </tr>
</tbody>
#Vue







你可能感興趣的文章

我要成為前端工程師的學習筆記:HTML & CSS 篇 - 文字排版、線條 Day4

我要成為前端工程師的學習筆記:HTML & CSS 篇 - 文字排版、線條 Day4

筆記、JS101 (常用內建函式)

筆記、JS101 (常用內建函式)

[Release Notes] 20200925_v1 - Support Blog Post Preview Modal

[Release Notes] 20200925_v1 - Support Blog Post Preview Modal






留言討論