1 min readJul 11, 2018
Thx Anthony writing such a great article, but i encounter a problem needs your help of vue inheritation knowledge.
I have a Base component, Base.vue
//Base.component<template>
<div id="canvas-container" />
</template><script>
export default {
created: function(){
this.initCanvas()
},
methods: {
initCanvas: function(){
//...
},
drawing: function(sketch){
//... this is the part need to be inherited
}
}
}
</script>
I got another component: Square.vue, which extend Base.vue
//Base.component<script>
import Base from './Base.vue';export default {
methods: {
drawing: function(sketch){
// overwrite Base.methods.drawing, or extend it
// super.drawing()
}
}
}
</script>
Any idea ?