Vue Table 表格利用formatter属性格式化数据


Vue Table 表格利用formatter属性格式化数据(关键代码):

<el-table-column
          :prop="item.prop"
          :label="item.label"
          :width="item.width"
          :key="item.prop"
          :formatter="replaceStr"
        ></el-table-column>
methods: {
onLineStr(row, column) {
      if (column.property == "列名") {
        return ["状态1", "状态2", "状态3"][row.列名];
      }
      return row[column.property];
    }
}

相关阅读 >>

vue基于iview table展示图片实现点击放大功能

深入研究vue cli3

vue 和 react 的优点有哪些

vue中怎么使用layui

vue架构是什么

eclipse支持vue

vue 轻量级图表组件

vue style中使用data中的变量的方法详解

bootstrap和vue的区别

vue cli是什么

更多相关阅读请进入《vue》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...