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

How to fix it when use v-for? #10

Open
jackchoumine opened this issue Nov 11, 2022 · 0 comments
Open

How to fix it when use v-for? #10

jackchoumine opened this issue Nov 11, 2022 · 0 comments

Comments

@jackchoumine
Copy link

Hi I watched your video on youtube, it help a lot. But i have some issues.

TabContainer work well like this.

<TabContainer v-model="activeTab">
    <TabHeader tab-id="1"> tab1 </TabHeader>
    <TabHeader tab-id="2"> tab2 </TabHeader>
    <TabHeader tab-id="3"> tab3 </TabHeader>

    <TabContent tab-id="1"> content 1 </TabContent>
    <TabContent tab-id="2"> content 2 </TabContent>
    <TabContent tab-id="3"> content 3 </TabContent>
  </TabContainer>

if i have many tabs i want to use v-for like this:

<TabContainer v-model="activeTab">
    <TabHeader :tab-id="item" v-for="(item, index) in ['1', '2', '3']" :key="index">
      tab{{ item }}
    </TabHeader>
    <TabContent tab-id="1"> content 1 </TabContent>
    <TabContent tab-id="2"> content 2 </TabContent>
    <TabContent tab-id="3"> content 3 </TabContent>
  </TabContainer>

console.log slots:
image

this first ele is Symbol(Fragment),the slots I actually need is in Symbol(Fragment) children. It does not work as except.
How can i fix it in a nice way?

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