vue-tabs icon indicating copy to clipboard operation
vue-tabs copied to clipboard

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

Open SSmJaE opened this issue 3 years ago • 0 comments

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

SSmJaE avatar Apr 10 '21 04:04 SSmJaE