Element设置某一行选中

迷南。 2022-12-05 13:49 478阅读 0赞

遇到问题请查看 博客

  1. // 基础布局 核心参数 ref highlight-current-row
  2. <el-table ref="monthlyPlanTable" highlight-current-row :data="tableData">
  3. <el-table-column prop="name" label="测试" align="center"></el-table-column>
  4. /el-table>
  5. // 方法 核心参数setCurrentRow this.$nextTick this.tableData是表格绑定的数据 this.tableData[0]代表第一行
  6. this.$nextTick(() => {
  7. if( this.tableData.length > 0){
  8. this.$refs.monthlyPlanTable.setCurrentRow(this.tableData[0])
  9. }
  10. });

发表评论

表情:
评论列表 (有 0 条评论,478人围观)

还没有评论,来说两句吧...

相关阅读