vue: "3.3.4"
pug: "3.0.2"
只有具名插槽报错,默认的正常
ToolBar
.sys_btns
template(#end)
span 123
ToolBar
...
slot(name="end")
...
报错:
[plugin:vite:vue] Codegen node is missing for element/if/for node. Apply appropriate transforms first.
网上能找到的方法都试了,没用。如下:
template(#end="")
template(v-slot:end)
template(v-slot:end="")
<template v-slot:end>xxx</template>
还有一个不知道怎么用:
globals: {
'vue-jest': {
pug: { doctype: 'html' }
}
}
即可。
解决这个问题很简单,找个 pug 输出 html,看怎样能满足 vue 的要求 就好。