element的el-table表格复选框只能选中一条,选择下一条,上一条去掉勾选。使用文档中select方法,el-table绑定一个ref。具体代码实现如下

<el-table :data="childList" border height="100%" size="mini"

       ref="multipleTable"  @select="select">
 <el-table-column  type="selection" width="55"></el-table-column>
 <el-table-column type="index" width="55" label="序号"></el-table-column>
 <el-table-column prop="pay_method" label="支付方式"  :show-overflow-tooltip="true"></el-table-column>
 <el-table-column prop="pay_account_no" label="付款方账号"  :show-overflow-tooltip="true"></el-table-column>
 <el-table-column prop="recv_account_no" label="收款方账号" :show-overflow-tooltip="true"></el-table-column>
 <el-table-column prop="amount" label="金额" :show-overflow-tooltip="true"></el-table-column>
  <el-table-column prop="summary" label="摘要" :show-overflow-tooltip="true"></el-table-column>
  <el-table-column prop="reference" label="备注" :show-overflow-tooltip="true"></el-table-column>
  <el-table-column prop="trade_date" label="交易时间" :show-overflow-tooltip="true"></el-table-column>

</el-table>

data(){

 return {
    bill_id:""
}

},
method:{

select(selection, row){
     this.bill_id = row.id;
     // 清除 所有勾选项
     this.$refs.multipleTable.clearSelection()
     // 当表格数据都没有被勾选的时候 就返回
     // 主要用于将当前勾选的表格状态清除
     if(selection.length == 0) return 
     this.$refs.multipleTable.toggleRowSelection(row, true);
},

}

toggleRowSelection:用于多选表格,切换某一行的选中状态,如果使用了第二个参数,则是设置这一行选中与否(selected 为 true 则选中)
————————————————
原文链接:https://blog.csdn.net/weixin_50999303/article/details/125164387

前言
写过工作流都会遇到这样的难题,希望流程的设计可以类似钉钉一样简单明了,而不是超级不有好的bpmn设计器,上网大概搜了一下实现方案,前端仿钉钉设计器一大堆,例如wflow,smart-flow-design,参照这些源码前端设计器不成问题


- 阅读剩余部分 -