setup语法糖不支持 render函数?-灵析社区

777七月

wx.createPage = function (MiniProgramPage) { MiniProgramPage.render = function (ctx) { } } render函数在setup语法糖情况下不调用

阅读量:19

点赞量:0

问AI
你可能需要使用jsx,先安装依赖vitejs/plugin-vue-jsx,然后在vite.config文件中添加 // jsx使用配置 esbuild: { jsxFactory: 'h', jsxFragment: "Fragment", jsxInject: "import { h } from 'vue';" } 使用时先引用 import { h } from 'vue' return () => h( 'i', { class: ["iconfont", "y-icon", props.icon] });