博主首页

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 @ 2025-01-16 15:40  笑~笑  阅读(36)  评论(0)    收藏  举报