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

解决方案:

render时添加title属性

效果展示:

粘贴图片

代码展示:

 

{
          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)
              ])
          }
      }

  

posted @ 2020-12-14 10:52  吃饭睡觉打痘痘  阅读(1271)  评论(0编辑  收藏  举报