Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a-tab-pane 使用v-for 生成时无法赋予key #3385

Open
day-dream-Lu opened this issue Dec 19, 2024 · 0 comments
Open

a-tab-pane 使用v-for 生成时无法赋予key #3385

day-dream-Lu opened this issue Dec 19, 2024 · 0 comments

Comments

@day-dream-Lu
Copy link

<a-tabs
      type="text"
      size="medium"
      default-active-key="0"
      lazy-load
      destroy-on-hide
      style="height: 65vh"
    >
      <a-tab-pane
        v-for="(firstTab, firstIndex) in firstTabs"
        :key="firstIndex"
        :title="firstTab.title"
      >
        <a-tabs
          type="text"
          size="mini"
          default-active-key="0"
          lazy-load
          destroy-on-hide
        >
          <a-tab-pane
            v-for="(secondTab, secondIndex) in firstTab.secondTabs"
            :key="secondIndex"
            :title="secondTab.title"
          >
            <component :is="secondTab.component" />
          </a-tab-pane>
        </a-tabs>
      </a-tab-pane>
    </a-tabs>

这段代码生成的a-tab-pane 的key赋值貌似与v-for 的key 冲突 导致default-active-key="0" 失效 无法打开默认tab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant