Merge pull request #76 from guzart/return-state-wihout-key

return state when using get without key
pull/83/head
Rich Harris 8 years ago committed by GitHub
commit b3acc6d9e6

@ -424,7 +424,7 @@ export default function generate ( parsed, source, options ) {
}; };
this.get = function get ( key ) { this.get = function get ( key ) {
return state[ key ]; return key ? state[ key ] : state;
}; };
this.set = function set ( newState ) { this.set = function set ( newState ) {

@ -0,0 +1,7 @@
export default {
test ( assert, component ) {
assert.equal( component.get('a'), 1 );
assert.equal( component.get('c'), 3 );
assert.deepEqual( component.get(), { a: 1, b: 2, c: 3 });
}
};

@ -0,0 +1,12 @@
<script>
export default {
data: () => ({
a: 1,
b: 2
}),
computed: {
c: ( a, b ) => a + b,
}
};
</script>
Loading…
Cancel
Save