https://blog.csdn.net/a772116804/article/details/106217414

    1. //这要放在数据加载完成后,且this.$nextTick(()=》{})不能少,少了后没效果
    2. this.$nextTick(()=>{
    3. //已经选择了的信息
    4. let pastSelect = this.multipleSelection.map(item => {return item.id})
    5. //list 所有的数据信息
    6. this.list.forEach(row => {
    7. //判断是否与已选信息对应,是就使用toggleRowSelection(row,true)将选项默认选中
    8. if(pastSelect.indexOf(row.id) >= 0){
    9. this.$refs.multipleTable.toggleRowSelection(row,true);
    10. }
    11. })
    12. })