父组件:
<div class="table-item" v-for="(item, index) in MonitorHost" :key='index'>
<hostTable :host='item'></hostTable>
</div>
子组件:
props: {
host: {
type: String
}
},
watch: {
async host(val) {
console.log(val);
let res = await this.findTask({...this.Form, host: val});
if (res && res.rltCode === 200) {
this.Form.Total = res.data.totalCount;
this.tableData = res.data.data;
}
}
},
发现watch根本就没有触发,如果不循环的话,就可以触发,这是什么原因