The table component of iview UI sets the checked state of the check box

 <Table ref="selection" @on-selection-change="selectionChanged" border :columns="columns" :data="list">

After selecting, submit the data, and you're done. .

To reopen, you need to echo the selected state of the checkbox:

setChecked() { //复选框选中状态
	let ids = this.select_list.map(v=>v.id);
	for (let index in this.$refs.selection.objData) {
	  if (ids.includes(this.$refs.selection.objData[index].id)) {
		 this.$refs.selection.objData[index]._isChecked = true;
	  }
   }
},
selectionChanged(e){
    this.select_list = e
}

Guess you like

Origin blog.csdn.net/qq_29483485/article/details/128386352