get this data in v-for


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







你可能感興趣的文章

React 基礎:關於性能優化

React 基礎:關於性能優化

Day3 安裝資料庫吧 ! FireBase!

Day3 安裝資料庫吧 ! FireBase!

回顧系列 | 2024 年轉職前端的學習歷程

回顧系列 | 2024 年轉職前端的學習歷程






留言討論





2
2
2