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

isValidParent() doesnt has effect in production build with minimize & typesctipt & class component #72

Open
SSmJaE opened this issue Apr 10, 2021 · 0 comments

Comments

@SSmJaE
Copy link

SSmJaE commented Apr 10, 2021

hi, I found a bug that in VTab, if you use isValidParent to validate the parent component is VueTabs after minimizing, because, in vue class component, the class name is set to vue component name, but after minimize, the class name may be modified, so

isValidParent () {
    return this.$parent.$options.name === 'vue-tabs'
},

does not has the effect, it will show an empty page.
there is a workaround that uses provide and inject, which can avoid this problem, just like what element UI has done
https://github.com/ElemeFE/element/blob/dev/packages/tabs/src/tab-bar.vue

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