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 @   晚睡的猫  阅读(6300)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示