elementui表格某一行默认展开

<el-table
        :show-header="false"
        ref="topicTable"
        :data="tableData"
        style="width: 100%"
        v-show="tableShow"
        :row-key="getRowKeys"
        :expand-row-keys="expands"
      >

表格头部加
:row-key=“getRowKeys”
:expand-row-keys=“expands”

 // 获取row的key值
      getRowKeys(row) {
        return row.id;
      },
 // 要展开的行,数值的元素是row的key值
      expands: [],

data里加入

   _this.expands.push(_this.$route.query.id); //展开某行的id

你可能感兴趣的:(vue)