El-table-column dynamic generation correlation

The header of

table is generated dynamically from the data returned by the interface, and the date and picture need to be displayed in the list. When I get the interface data, I convert it into a date display, but I don"t know what to do with the picture to display it.

<el-table class="el-table" :data="dialogList" border fit highlight-current-row>
          <el-table-column :label="item.label" :key="item.label" :prop="item.prop" v-for="item in labelTitle"
                           align="center">
          </el-table-column>
        </el-table>

ask the bosses how to deal with pictures for a column separately in column? Because it is generated dynamically, I don"t know how to add the tag to that column of the picture.

Apr.03,2021

The inescapable fact of

is that you must know which column it is, whether it's flag, type, index or identifying content . Just use v-if .

<el-table-column :label="item.label" :key="item.label" :prop="item.prop" v-for="item in labelTitle" align="center">
  <template slot-scope="scope">
    <img :src="scope.row[item.prop]" v-if="item.type === 'img'"></img>
    <span v-else>{{scope.row[item.prop]}}</span>
  </template>
</el-table-column>
Menu