props: ['articleProp'],
data() {
return {
inited: false,
article: {
title: null,
description: null
}
}
},
watch: {
article: {
deep: true,
handler(newValue, oldValue) {
if (this.inited) {
console.log('triggered')
}
}
}
},
mounted() {
if (this.articleProp) {
Object.keys(this.articleProp).filter(key => key in this.article).forEach(key => {
this.article[key] = this.articleProp[key]
})
this.inited = true
}
}
раутакакой name?