Skip to content

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

@SSmJaE

Description

@SSmJaE

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions