I'm creating this text editor, with the field of name, and address
<ckeditor :editor="editor" v-model="data[index].name">
<ckeditor :editor="editor" v-model="data[index].address.1">
<ckeditor :editor="editor" v-model="data[index].address.2">
and the data property
data() {
return {
data:[],
index:0,
editor: customedit
};
},
the editor also have two button, next and back, with the method add and substracting "index". the data, is loaded before mount from server, with structure like this
serverdata = [{name:'name1',address:{1:'address 1',2:'address 2'}} , {name:'name2',address:{1:'address 4',2:'address 4'}}]
so what I want to do is, after data from server is loaded, user can move between data, and when user make change to it, the data index that user make change to will be logged. so far I have been using deep watcher like this:
watch: {
data: {
handler(val) {
console.log('the data is changed');
console.log(this.index + 1);
},
deep: true
}
},
but even when there are no change, when I click next, the log is shown, thanks for any help/suggestion