R
R
rsoinvi2019-01-08 16:10:19
Vue.js
rsoinvi, 2019-01-08 16:10:19

How to extend a component with extends in Vue?

Tried with arrays but doesn't work. Tell me how to properly extend the component.

name: "product-view",
        extends: [BaseProductView, BaseBannerPromotion],
        data() {
            return {
                isCopy: false
            }
        },

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Klein Maximus, 2019-01-10
@rsoinvi

Extend only works with one parent component.
To extend a component with the functionality of multiple entities, use mixins/mixins .

0
0xD34F, 2019-01-08
@0xD34F Vue.js

Tried with arrays but doesn't work.

And it shouldn't - we look at the documentation , we see that there is no array among the allowed types.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question