elementUI toggleRowSelection设置无效

        // 初始化禁选的复选框
        checkboxInit(row, index) {
            var that = this;
            that.$nextTick(() => {
                console.log(that.$refs.multipleTableGood);
                if (that.$refs.multipleTableGood) {
                    that.$refs.multipleTableGood.clearSelection();
                }
                that.tableData.forEach(row => {
                    for (let j in that.selectData) {
                        if (row.id == that.selectData[j].id) {
                            console.log("相同");
                            that.$refs.multipleTableGood.toggleRowSelection(
                                row,
                                true
                            );
                        }
                    }
                });
            });
        },

$nextTick解决

猜你喜欢

转载自blog.csdn.net/qq_37588752/article/details/85261943
今日推荐