![](/img/trans.png)
[英]Bootstrap Vue table: show different details with each show details button in each row
[英]Bootstrap Vue table: show details when row clicked
試圖實現與文檔體驗不同的體驗:不是通過單擊按鈕而是在單擊行時顯示行詳細信息。 並且文檔缺乏關於如何使其與示例不同的細節。
<b-table
v-if="tableIsReady"
:items="deals"
:fields="fields"
:per-page="recordsPerPage"
no-local-sorting
@sort-changed="sorting"
responsive
flex
striped
hover
@row-clicked="expandAdditionalInfo"
>
<template slot="row-details" slot-scope="row">
<b-card>
<h1>hello</h1>
</b-card>
</template>
</b-table>
這是我的功能,但我認為它根本不起作用
expandAdditionalInfo(row) {
row.showDetails();
}
很難找到...但只需添加以下內容:
@row-clicked="item=>$set(item, '_showDetails', !item._showDetails)"
即使_showDetails
不存在, $set
也會保留反應性。
遺憾的是,行對象不可訪問,因此toggleDetails 不是這里的選項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.