Check out this simple shopping cart demo:
http://plnkr.co/edit/CHt2iNSRJAJ6OWs7xmiP?p=preview
A user can pick a veggie and a fruit, and it will be added into
I found this technique to be more simple/satisfactory, as I prefer composition over inheritance:
export default {
foo: function() { alert("foo!") }
}
...
This will also allow you to write Vue-agnostic tests.
NOTE: if you need foo to run in Vue-scope replace
this.foo = shared.foo
withthis.foo = shared.foo.bind(this)