vue computed
computed:{ areaAndDstri:{ get:function (){ return { areaId:this.areaId, districtId:this.districtId, dateTime:this.dateTime } } } }, watch:{ areaAndDstri(newV,oldV){ console.log(newV) this.$emit('areaDstrId',newV) } },
在computed中被创建的属性可以 像 的data那样被使用和监听等一系列操作
在子组件中可以利用这个向父组件监听多个值只发送一次emit
https://cn.vuejs.org/v2/api/#computed