handler方法,immediate属性deep属性:
handler(newVal, oldVal){ if (newVal > 0) { this.ableAdd = true this.getListData() } else { this.ableAdd = false this.tableData = [] this.total = 0 } }, immediate: true, deep: true
handler(newVal, oldVal){ if (newVal > 0) { this.ableAdd = true this.getListData() } else { this.ableAdd = false this.tableData = [] this.total = 0 } }, immediate: true, deep: true