How does vue determine whether the peer component is loaded or not?

topic description

I have two component templates An and B. I want to send values from A template to B template when the page is loaded. The view page order is
< router-view name= "A" > < / router-view >
< router-view name= "B" > < / router-view >

.

I wrote the value passing method in the mounted cycle of A, but found that template B has not been mounted yet. How to solve
mounted: function () {

    this.sendUser();//,B

},

Jul.27,2021

can be solved with vuex,

or you can pass the value in A to the parent component of A

, and then to B

.

eventBus find out.
vuex find out.


try using watch to listen for changes in values in data

data(){
    return {
        isBLoading:false
    }
},
watch:{
    isBLoading: function (val, oldVal) {
      console.log('new: %s, old: %s', val, oldVal)
    },
}

this._isMounted

This

is in the property of

vue.

  • Strengthen the function of paying questions

    I think technology paid Q & An is a blue sea. At present, there are traditional education and training institutions, books, consultants (mainly legal, business, and technical consultancy services), as well as popular broadcasting (such as Himalayas) and...

    Mar.03,2021
  • How to withdraw from the public trial of codeshelper

    I would like to ask the bosses, how to withdraw from this so-called public trial center? Or don t tell this to come out? I really don t understand what it means to do this. Is it mandatory for everyone to review? Are there any users who don t wan...

    Dec.08,2021
Menu