elementUI table 实现表格展示行只展示一行
表格加入
:row
-key
='getRowKeys'
:expand
-row
-keys
="expands"
@expand
-change
="expandSelect"
data加入
data
:{
expands
: [],
},
methods加入
getRowKeys(row
) {
return row
.id
},
expandSelect(row
, expandedRows
) {
var that
= this
if (expandedRows
.length
) {
that
.expands
= []
if (row
) {
that
.expands
.push(row
.id
)
}
} else {
that
.expands
= []
}
},
转载请注明原文地址:https://ipadbbs.8miu.com/read-48098.html