-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Error when hidding tab panel using v-if #1186
Comments
Same goes for all other "Components" that don't really "use" their Child Components but rather their raw |
As a temp fix you could change tabs() {
const tabs = [];
this.$slots.default().forEach(child => {
if (this.isTabPanel(child)) {
tabs.push(child);
}
else if (child.children.length > 0) {
child.children.forEach(nestedChild => {
if (this.isTabPanel(nestedChild)) {
tabs.push(nestedChild);
}
});
}
}
);
return tabs;
}, to tabs() {
const tabs = [];
this.$slots.default().forEach(child => {
if (this.isTabPanel(child)) {
tabs.push(child);
}
else if (child.children.length > 0) {
// check fo children first before looping them
if(!child.children || !Array.isArray(child.children)){
return;
}
child.children.forEach(nestedChild => {
if (this.isTabPanel(nestedChild)) {
tabs.push(nestedChild);
}
});
}
}
);
return tabs;
}, This will allow you to use comments as well. Currently writing comments in their components will result in an error. <TabView>
<!-- place your comment -->
</TabView> |
Thanks! I'll give it a try. |
Thanks a lot for your report! Fixed now! Best Regards, |
Hello, in issue #1184 I proposed adding a prop for hidding a tab pane but I was told that it might work by using v-if on the tab pane. Nonetheless, when I do this I get the following error: Uncaught (in promise) TypeError: child.children.forEach is not a function.
Don't know if it's a bug or it's not supported yet. If there's a workaround I'd love to hear it.
I'm using prime vue 3.3.5.
Thanks.
The text was updated successfully, but these errors were encountered: