this.$watch() 的使用(这里可以放在Vue生命周期钩子里):

this.$watch('query', (newQuery) => {
            this.$emit('query', newQuery)
        })

watch:{}的使用(一个方法):

watch:{
  query(newQuery){
    this.$emit('query', newQuery)
  }
}
Logo

前往低代码交流专区

更多推荐