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







你可能感興趣的文章

PHP 內建 session 機制

PHP 內建 session 機制

用 PHP 打造留言板 實作筆記

用 PHP 打造留言板 實作筆記

1 個 div 和 4 行 CSS 就能更了解瀏覽器渲染引擎

1 個 div 和 4 行 CSS 就能更了解瀏覽器渲染引擎






留言討論





2
2
2