watch: { healthData: { deep: true, // 深度监听 immediate: true, // true的话,不管数据是否有变化,进来就会运行 handler: function(newVal, oldVal){ this.form = newVal; } }, containerPortList: { deep: true, handler: function(newVal){ // 访问方式端口数据变化的相关操作 if(!this.form.port) return; if(!newVal.includes(this.form.port)) { this.$set(this.form,'port', null); } } }, // 监听对象里的某一项 'form.command'(newVal) { if(newVal) { this.$set(this.form, 'commandList', [newVal]); } } },