now there is a need to switch between dynamic routes (the actual route is the same address,: id is different), rather than the jump between different routes, so that the lifecycle function cannot be triggered and different id values cannot be obtained.
<div class="child">
<div></div>
<ul>
<router-link tag="li" :to=""/docLook/"+item.id" v-for="item in communityList" :key="item.id"
>
{{item.name}}
</router-link>
</ul>
wacth:{
id(){
alert(this.id)
}
},
mounted () {
this.id =this.$route.params.id;
},