vue ant design Uncaught ReferenceError: h is not defined

181 阅读1分钟

import Vue from 'vue'

const h = new Vue().$createElement

customRender: (text, record) => {
  let childVal = ''
  const link = record.link
  if (link) {
    childVal = h(
      'a',
      {
        domProps: {
          target: '_blank',
          href: link
        }
      },
      [text]
    )
  } else {
    childVal = text
  }
  // text 当前行的值,record 当前行数据
  return {
    children: childVal,
    attrs: {
      rowSpan: 2
    }
  }
}