美文网首页
vue element-ui table 对获取的数据进行tog

vue element-ui table 对获取的数据进行tog

作者: 小狼在IT | 来源:发表于2018-08-18 09:28 被阅读0次
    <el-table :data="Detail"
                        ref="DetailTable"
                        >
    </el-table>

    data() {
        return {
           Detail: []
        }
    }

    methods: {
        get_Detail (){
        let getDetail = []  //获取的数据
        this.Detail = getDetail 
        let _this = this
        //必须要在$nextTick里面执行,否则toggleRowSelection无效
        _this.$nextTick(function(){
                _this.$refs.DetailTable.toggleRowSelection(_this.Detail[0])        
                                }
                            }
                            
                        }
                    }) 
    }
}

相关文章