Created
August 24, 2017 23:02
-
-
Save tomnagengast/c9530929d392e49d442c84aa343c4c8d to your computer and use it in GitHub Desktop.
https://forum.vuejs.org/t/es6-subclassing-of-embeded-types-not-working-inside-vues-data-option/15721
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Similar to the Lamda setup | |
class Model { | |
constructor() {} | |
create() {} | |
get() {} | |
update() {} | |
delete() {} | |
} | |
class Bottle extends Model { | |
constructor() { | |
super() | |
} | |
} | |
export default { | |
data: function() { | |
return { | |
bottle: new Bottle() | |
} | |
} | |
methods: { | |
saveBottle() { | |
this.bottle.save(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment