in a dynamic routing page
adText is the data initialized in mounted. The value of adText can be displayed normally when entering the routing page, but the adText becomes empty when switching between routing pages
mounted () {
this.initAdText()
},
methods: {
initAdText(){
for(let i in COUNTRY_ID){
if(this.country_id==COUNTRY_ID[i]){
this.adText = this.adTextList[i].left
this.use = this.adTextList[i].right
}
}
}
}
this value has not been changed anywhere except in mounted. What is the reason for this? Does it have to be assigned in asyncData?
and oddly enough, even if this method is executed after a dynamic route switch, the page view is still empty