Vue sub-component watch parent component props, transmitted by no response, may I ask what's going on?

  props: ["content", "visible"],

  watch: {
    visible: {
      handler: function(val, oldval) {
        console.log("watch visible changed!")
        if(val){
          this.initDefault(this.content)
        }
      },
      deep: true,
      immediate: true
    },

    "content.id": {
      handler: function(val, oldval) {
        console.log("watch content.id changed!")
        if(val !== oldval) {
          this.initDefault(this.content)
        }
      },
      deep: true,
      immediate: true
    },
  },

No matter how the props changes, there is not a single print of the two watch. The same code has been used on other pages without any problem, but it is no good to use it in another place. There is no way to troubleshoot this kind of stupid problem like vue. Is there any other way except to close your eyes and guess, or smash the computer?

Mar.28,2021

is the object content without the attribute id at the beginning


encountered the same problem


did the parent component listen for the change and change it with setter?


have you solved it? I have the same problem

.
Menu