data() {
return {
city: '',
country: ''
}
},
computed: {
address() {
const { city, country } = this
return {
city,
country
}
}
},
watch: {
address: {
handler: function(val) {
console.log('address change: ', val)
},
deep: true
}
}
this.$nextTick
watch: { //渲染完后,监听
totalList:function() {
this.$nextTick(function(){
this.homeHeight = this.$refs.homeWrapper.offsetHeight
console.log('监听高度:', this.homeHeight)
});
}
},