<el-table
   ref="table"
   v-loading="listLoading"
   :data="list"
   highlight-current-row
   @current-change="handleCurrentChange"
>
</el-table>

watch: {
  'list'(){ // data绑定的值
    this.$nextTick(()=>{ // nextTick必写
     console.log(this.$refs.table); // refs给的table值
     this.$refs.table.setCurrentRow(this.list[0]);
   })
  }
}

表格页面初始化默认展示第一条数据

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2021-11-16
  • 2021-09-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-26
  • 2021-06-18
  • 2022-12-23
  • 2021-11-23
  • 2021-09-30
相关资源
相似解决方案