vue+element 表格 填写时间列 有显示时间 没有显示 ‘-’

效果如下

代码:

这里的writeDate也是后台返回的字段

    <el-table-column
        prop="writeDate"
        header-align="center"
        align="center"
        label="填写时间"
        width="100"
      >
        <template slot-scope="scope">
          <div v-if="scope.row.writeDate">{
   
   { scope.row.writeDate }}</div>
          <div v-else>-</div>
        </template>
      </el-table-column>

猜你喜欢

转载自blog.csdn.net/weixin_49393290/article/details/121207083