ant design vue table报错h is not defined

报错原因

使用table时由于columns数据太多,所以将columns中的数据拆分到一个单独的常量js文件中,又因为需要使用customRender,里面有<a-tag>之类的标签,需要使用jsx进行渲染,因此报错

解决方法

地址:https://github.com/vueComponent/ant-design-vue/issues/1183

在单独的js文件中进行如下写法

import Vue from 'vue'
const h = new Vue().$createElement

 

posted @ 2022-11-10 11:06  vickylinj  阅读(166)  评论(0编辑  收藏  举报