亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

如何點(diǎn)擊用戶并查看用戶數(shù)據(jù)?
P粉448346289
P粉448346289 2024-03-28 19:01:02
0
1
598

我正在使用 VueJS 做一個(gè)項(xiàng)目,我需要以下內(nèi)容:

使用 API 并獲取主頁(yè)中的用戶列表。

當(dāng)單擊用戶的按鈕時(shí),我需要重定向到另一個(gè)組件并在該組件中輸出該用戶的詳細(xì)信息(僅我單擊的用戶的詳細(xì)信息)。

這是顯示用戶信息的表格

 <v-data-table hide-actions flat :headers="headers" :items="doctors">
        <template v-slot:items="props">
          <td>{{ props.index + 1 }}</td>
          <td>{{ props.item.profile.full_name }}</td>
          <td>{{ props.item.email }}</td>
          <td>{{ props.item.username }}</td>
          <td>{{ props.item.updated_at }}</td>
         <td> 
          <v-btn outline small color="indigo" @click="view(props.item)">
                                <i class="fa fa-eye"></i> &nbsp; make payment
                            </v-btn>
         </td>


        </template>
        <template v-slot:no-results>
          <h6 class="grey--text">No data available</h6>
        </template>
      </v-data-table>

視圖函數(shù)在方法中

 view() {
            window.open(`/finance/pay-doctors/${item.id}`, "_blank");
        },

我創(chuàng)建了一條動(dòng)態(tài)路線

 { path: '/finance/pay-doctors/:id', component: DoctorDetails}

無(wú)法創(chuàng)建 DoctorDetails 并顯示數(shù)據(jù)

P粉448346289
P粉448346289

全部回復(fù)(1)
P粉268654873

我建議您首先嘗試使用路由器推送。
因此請(qǐng)使用

<script>
export default {
    methods: {
        view(id) {
            this.$router.push({ path: `/finance/pay-doctors/${item.id}` })
        }
    }
}
</script>

確保您的路由器已正確設(shè)置 感謝您的 Vue 開發(fā)工具,您擁有正確的狀態(tài)。

此外,請(qǐng)確保在 DoctorDetails 上有一些東西可以獲取用戶的數(shù)據(jù)。

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板