A页面
EventBus.$emit("postMobilesStr",data)
B页面
data里面重新定义一个值,用EventBus代替this
data(){
return {
str:""
}
}
EventBus.$on("postMobilesStr", ({ mobilesStr }) => {
//用EventBus代替this
EventBus.str = mobilesStr
});
EventBus.$emit("postMobilesStr",data)
data里面重新定义一个值,用EventBus代替this
data(){
return {
str:""
}
}
EventBus.$on("postMobilesStr", ({ mobilesStr }) => {
//用EventBus代替this
EventBus.str = mobilesStr
});