vue 表头指定字符换行

//表头指定字符换行
function install(Vue) {
 Vue.prototype.renderheader = function (h, { column }) {
    return h("span", {}, [
      h("span", {}, column.label.split("//")[0]), // 其中//也可以用其他符号替代
      h("br"),
      h("span", {}, column.label.split("//")[1]),
    ]);
  };
}
使用
 <el-table-column
            :render-header="renderHeader"
            label="xxxx"
            width="120"
            align="center"
          />

 

posted @ 2024-10-08 14:19  柒言·C  阅读(64)  评论(0编辑  收藏  举报