点击上下架状态但是展开行依旧是展开的
<el-table :data="shopData"
border
style="width: 100%"
:row-key="getRowKeys"
:expand-row-keys="expands">
<el-table-column type="expand" >
<template slot-scope="props">
getRowKeys(row) {
return row.infoId
},//当前行的唯一标识
页面初始化展开某一行的话
mounted(){
this.expands.push(this.dataList[0].infoId)
}
handleStatusChange(row) {
// return
console.log(row,'2223');
('确认要' + text+ '商品')
let text = row.status === 0 ? "下架" : "上架";
this.$modal
.confirm('确认要"' + text + '"该商品吗?')
.then(function () {
// 调用 商品 上下架 接口,
return statusEditor({
// productId : row.productId,
// stationId: row.stationId,
// modelId:row.modelId,
mid:row.mid,
status:row.status,
});
})
.then(() => {
this.$modal.msgSuccess(text + "成功");
this.loadProduct();
this.expands.push(this.dataList[0].infoId)//当前行id 放入
})
.catch(function () {
row.status = row.status === 0 ? 1 : 0;
});
},