博主首页

vue2动态给标签绑定属性

  <el-table-column label="保司提交资料报文" prop="insuranceSubmitData"  show-overflow-tooltip />
将show-overflow-tooltip改为动态绑定
此处是为了将表格渲染封装成通用组件
复制代码
      <template v-for="item in arr" >
        <template v-if="item.type && item.type === 'dict'">
          <el-table-column :label="item.label" :prop="item.prop" v-bind="item.attr" >
            <template slot-scope="scope">
              <div>{{dictByItem(item,scope.row)}}</div>
            </template>
          </el-table-column>
        </template>
        <template v-else>
          <el-table-column  :label="item.label" :prop="item.prop" v-bind="item.attr" />
        </template>
      </template>
复制代码
复制代码
let arr = [
  { label: "保司理赔失败原因", prop: "insClaimProgressDesc" ,attr: {"show-overflow-tooltip": true} },
  { label: "备注", prop: "remark" },
  { label: "驳回原因", prop: "auditRemark" },
  { label: "完成时间", prop: "finishTime" },
  { label: "哪一方取消的订单", prop: "cancelBy", type: "dict", dictName: "cancelBy" },
  { label: "取消时间", prop: "cancelTime" },
  { label: "取消原因", prop: "cancelReason" },
  { label: "创建时间", prop: "createTime" },
  { label: "更新时间", prop: "updateTime" },
]
复制代码

 

posted @   笑~笑  阅读(9)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
历史上的今天:
2023-01-16 jpa连表查询
点击右上角即可分享
微信分享提示