The problem that V-IF can not respond dynamically

problem description

< my-browser VMI if = "busShowInfo" > < / my-browser >
v-if binds a module to display dynamically, but it can only be displayed according to the initial value, not loaded or destroyed dynamically. With watch snooping, the busShowInfo has changed, but the component is not dynamically loaded. There is no misinformation.

the environmental background of the problems and what methods you have tried

through watch listening, confirm that the property has become true, but the component is not loaded.

related codes

<my-browser v-if="busShowInfo"></my-browser>

data() {
    return {
        busShowInfo: false
   }
}

watch:{
    busShowInfo: function (val, oldVal) {
        console.log("new: %s, old: %s", val, oldVal)
    }
}

what result do you expect? What is the error message actually seen?

expects to control the loading and destruction of components through the busShowInfo property. There is no misinformation.

Jun.10,2021

Brother, alas, misspelled busShowInfo busShowImInfo


I don't see any problem in the code provided. Check yourself to see if there is any other place to modify the value of this attribute


type a few more debug in other places. BusShowInfo must have been put back on false somewhere else. No, no, no.

Menu