Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions example/components/nested-with-vmodel.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="justify-content-between row">
<nested-test class="col-8" v-model="elements" />
<raw-displayer class="col-4" :title="'Vuex Store'" :value="elements" />
<nested-test class="col-8" v-model="list" />
<raw-displayer class="col-4" :title="'Vuex Store'" :value="list" />
</div>
</template>

Expand All @@ -17,14 +17,17 @@ export default {
NestedTest,
rawDisplayer
},
computed: {
elements: {
get() {
return this.$store.state.nested.elements;
data: function() {
return {
list: this.$store.state.nested.elements
};
},
watch: {
list: {
handler: function(val) {
this.$store.dispatch("nested/updateElements", val);
},
set(value) {
this.$store.dispatch("nested/updateElements", value);
}
deep: true
}
},
methods: {}
Expand Down