I'm using a mixin to add and override vue data. I am able to add new data, but I cannot seem to override existing data. Here is the simple code:
var mixin = {
data: function() {
return {
foo: 'boo',
test: 'blah'
}
}
}
var vm = new Vue({
el: '#vue-instance',
mixins: [mixin],
data: function() {
return {
foo: 'bar'
}
}
});
When I run it, 'test' equals 'blah' properly, but 'foo' still equals 'bar'. Is there anyway to have a mixin override existing vue data in addition to adding new data?
Here is a fiddle: