How do I extend another VueJS component in a single-file component? (ES6 vue-loader)

后端 未结 5 830
迷失自我
迷失自我 2020-12-14 14:47

I am using vue-loader (http://vuejs.github.io/vue-loader/start/spec.html) to construct my *.vue single-file components, but I am having trouble with the process

5条回答
  •  时光说笑
    2020-12-14 15:37

    The proper way to do this would be to use mixins: http://vuejs.org/guide/mixins.html

    Think of mixins as abstract components, which you can extend. So you could create a mixin with any functionality you wanted to have in both, and then just apply it to each of your components.

提交回复
热议问题