el-table表头自定义内容

 renderHeaderBig(h, { column, $index }) {
      // console.log(column.label);
      return h("div",{
        class: {
                'text_overflowd': true,
                 
              },
              // style:'100px;',
      }, [
        h(
          "el-tooltip",
          {
            props: {
              content: (function() {
                return `${column.label}`;
              })(),
              placement: "right"
            }
          },[
            h("div",{
              class: {
                'text_overflowd': true,
              }, 
               style:'100px;margin:0 auto',
            }, [
            h("span", {
              class: {
                'text_overflowd': true,
                 
              },
              style:'100px;',
              domProps: {
                innerHTML: column.label
              }
            }),
            // h("span", column.label),
            // h("span", {
            //   class: {
            //     "el-icon-question": true,
            //     woca: true
            //   }
            // })
          ])
          ]
         
        )
      ]);
      // return h("span", {}, [
      //   h("span", {}, "时间片段"),
      //   h(
      //     "el-popover",
      //     {
      //       props: {
      //         placement: "top-start",
      //          "200",
      //         trigger: "hover",
      //         content: "领先/落后品类=单店平均单量-该品类城市店均单量"
      //       }
      //     },
      //     [h("i", { slot: "reference", class: "el-icon-question" }, "")]
      //   )
      // ]);
      // return h(
      //     'el-tooltip',
      //     {
      //       props: {
      //         content: (function() {
      //           return `${column.label}`
      //         })(),
      //         placement: 'top'
      //       }
      //     },
      //     [ h('span', 'wocai'), h('span', {
      //         class: {
      //           'el-icon-question': true,
      //           'woca':true
      //         }
      //       })
      //     ]
      //   )
      // return h("div", [
      //   h(
      //     "el-tooltip",
      //     {
      //       props: {
      //         content: (function() {
      //           return `${column.label}`;
      //         })(),
      //         placement: "top"
      //       }
      //     },
      //     [
      //       h("span", column.label,{
      //         class: {
      //           "el-icon-question": true
      //         }
      //       })
      //     ]
      //   )
      // ]);
    },

https://segmentfault.com/a/1190000022739301

原文地址:https://www.cnblogs.com/dianzan/p/12993908.html