cols: [
{ width: 250,
  align: 'center',
  renderHeader: (createElement, {col}) => {
    return createElement('Select', {
      props: {
        value: this.visitRecordData.identifierDataIndexType,
        transfer:true
      },
      on: {
        'on-change': (value) => {
          this.visitRecordData.identifierDataIndexType = value
        }
      },
      style: {
        width: '150px',
      }
    }, [
      createElement('Option', {
        props: {
          value: 'usual'
        },
        style: {
          fontWeight: 'normal'
        }
      }, '名字'),
      createElement('Option', {
        props: {
          value: 'official'
        },
        style: {
          fontWeight: 'normal'
        }
      }, '年龄'),
    ])
  },
  render: (createElement, {row}) => {
      let showText=row.identifier && row.identifier.find(item=>{
        return item.use===this.visitRecordData.identifierDataIndexType
      }).value
    return createElement("span", {}, showText?showText:"")
  }
},
]

接口返回的参数

iview表格头部使用下拉框

最后的效果

iview表格头部使用下拉框

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案