Article From:https://segmentfault.com/q/1010000010266795
Question:
<router-link tag="li" v-for='level in levels' :key='level.l_level' :to="{ path: '/setting/level', query: { level: level.l_level }}" exact active-class="active" >
                                   {{level.levelName}}({{level.lcount}})
                                </router-link>
<router-view :allstudents.sync="this.allstudents"></router-view>

When the allstudents data in the routing changes, how does the component in the route detect?

Answer 0:

If it’s a component, it can be processed by $omit. If it’s Router, try VUEX.

Answer 1:

new Vue({

watch: {
    "$route": callback(to, from){
        to.path == '/path'
    }
}

})

//You can tell if to.path is equal to the path you want to compare.

Answer 2:

If you don’t detect your feelings, it will change automatically. Because you’ve already bound the father and child components. The subcomponents are caught in props

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *