vueComponent/ant-design-vue

Error Codegen node is missing for element/if/for node. Apply appropriate transforms first.

gethin036 opened this issue · 0 comments

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.1

Environment

windows chrome

Reproduction link

Edit on CodeSandbox

Steps to reproduce

当我们循环 a-tab-pane 的时候,因为里面的内容不一致,使用了 v-if 判断,并用 template 包裹,然后 a-tab-pane 又想使用 tab slot,所以也使用了 template #tab

<template>
  <a-tabs v-model:activeKey="activeKey">
    <a-tab-pane v-for="pane in paneList" :key="pane.key">
      <template v-if="pane.tabTitle === 'Tool Chain'">
        <template #tab>{{ pane.tabTitle }}</template>
        Content of Tab Pane 11
      </template>
      <template v-else>
        <template #tab>
          <!-- icon -->
          {{ pane.tabTitle }}
        </template>
        Content of Tab Pane 22
      </template>
    </a-tab-pane>
  </a-tabs>
</template>

What is expected?

tab slot 插槽能正常使用

What is actually happening?

报错,如标题
Error Codegen node is missing for element/if/for node. Apply appropriate transforms first.