antd-vue 表头,超出显示省略号...

就是title可以用函数返回

···

    const obj = {
      key: key,
      dataIndex: key,
      // title: data,
      title: (val) => {
        const style = {
          maxWidth: '200px',
          overflow: 'hidden',
          whiteSpace: 'nowrap',
          textOverflow: 'ellipsis',
          cursor: 'pointer'
        }
        return (
          <div style={style} title={data}>{data}</div>
        )
      },
      align: 'center'
    }

···

posted @ 2021-03-26 15:47  山村码农  阅读(1159)  评论(0编辑  收藏  举报