export default {
name: 'login',
data () {
return {
navcard:['首页','工作室简介','人员分工','项目计划','重点故障分析','技能创新','带徒传技','技能培训','技术交流论坛'],
msg:'主页'
}
},
created:function(){
var self=this
bus.$on('login_loginstae',function(a){
console.log(a);
self.msg=a;
})
}
}
bus.$on received a, console.log (a) shows that the value of a is fine, but self.msg=a does not work. The msg on the page will not change.
..To be honest.
I tested
It works...
It should be that create has not been mounted yet, try mounted
You may not believe it. After commenting on yours, I tried it again and it worked. It feels like the node cache is a bit powerful and it didn’t get better in the afternoon