render时添加title属性

效果展示:

iview table组件内容过多用“...”代替,鼠标悬停显示全部内容

代码展示:

 

{
          title: '地域',
          key: 'area',
          width: 100,
          align: 'center',
          render: (h, params) => {
              return h('div', [
                  h('span', {
                      style: {
                          display: 'inline-block',
                          width: '100%',
                          overflow: 'hidden',
                          textOverflow: 'ellipsis',
                          whiteSpace: 'nowrap'
                      },
                      domProps: {
                          title: params.row.area
                      }
                  }, params.row.area)
              ])
          }
      }

  

相关文章: