The use of el-table in element-ui (get all the data in the current column)

The cell content is determined by an attribute in the data bound to the table

Use slots to customize what is displayed

Get all the data in the current column

      <el-table-column
        label="姓名"
        width="180">
        <template slot-scope="scope">
          {
   
   {scope.row.name}}
        </template>
      </el-table-column>
可以在 后端返回数据不是我们想要的时候 做判断处理


template自定义单元格内容的方式(具名插槽)
scope.row:当前行的所有数据
scope.$index:当前列的索引

Guess you like

Origin blog.csdn.net/Xiang_Gong_Ya_/article/details/128658152