南京电商网站开发,专业定制网站,线下推广100种方式,天津做网站设计公司一.需求 在页面刚打开就默认选中指定项。
二.方法Table Methods
toggleRowSelection用于多选表格#xff0c;切换某一行的选中状态#xff0c;如果使用了第二个参数#xff0c;则是设置这一行选中与否#xff08;selected 为 true 则选中#xff09;row, selected
详细…一.需求 在页面刚打开就默认选中指定项。
二.方法Table Methods
toggleRowSelection用于多选表格切换某一行的选中状态如果使用了第二个参数则是设置这一行选中与否selected 为 true 则选中row, selected
详细请看elementui官网https://element.eleme.io/#/zh-CN/component/table
三.代码
mounted () {// multipleSelection 想选中的数据 tableData表格数据this.$nextTick(() {this.multipleSelection.forEach(row {this.$refs.multipleTable.toggleRowSelection(this.tableData.find(item {return row.date item.date;}), true)})})},
四.效果图