iview怎么在表格中渲染Tooltip文字提示

  • Post author:
  • Post category:其他


{
            title: '问题描述',
            key: 'ProblemDescription',
            render: (h, params) => {
             let texts=params.row.ProblemDescription;
             if(params.row.ProblemDescription !=null){
               if(params.row.ProblemDescription.length>20){
                 texts=params.row.ProblemDescription.slice(0,10)+'...'  //进行数字截取
               }else{
                 texts=params.row.ProblemDescription
               }
             }
              return h('div', [
                h('Tooltip', {
                  props: {
                    placement: 'top',
                    transfer: true
                  }
                },[texts,h('span',{
                  slot:'content',
                  style:{
                    whiteSpace:'normal'
                  }
                },params.row.ProblemDescription)
                ])
              ])
            }
          },

转载自https://blog.csdn.net/weixin_39494582/article/details/84284250