实用技巧
1.view层更新后进行操作
this.$nextTick(() => {
})2.watch深度监听
data() {
return {
info: Object
}
},
watch: {
info: {
handler(val) {
console.log(val)
},
deep: true
}
}3.watch监听对象中的某个属性
4. 阻止路由跳转
5.APP中点APP自带返回按钮时不关闭页面,而是路由回退
6.vue methods的方法中定义函数
7.vue方法暴露给外部
8. Vue 不能检测到对象属性的添加或删除
9. Vue 不能检测以下变动的数组
Last updated