element中使用Table组件,出现条件判断的写法

 <el-table-column v-for="(item, index) in tableColumns" :key="index" :prop="item.prop" :label="item.label" :min-width="item.width">
    <template  slot-scope="scope">
         <span v-if="index == 2">
           {{scope.row.attachment ? scope.row.attachment : scope.row.url}}
          </span>
          <span v-else>
            {{scope.row[item.prop]}}
          </span>
     </template> 
  </el-table-column>

 

posted @ 2020-10-28 17:27  晚睡的猫  阅读(6342)  评论(0)    收藏  举报