我創建了一個Global.vue文件代碼如下<script>
const memu=''
export default
{
memu,//
}</script>并在main中掛載到全局Vue.prototype.$global = global在login頁,存入了數據并且成功打印,以下是代碼片段,存入之后有個路由跳轉this.$global.memu = response.data.responseDataObject.firstModel
console.log(this.$global.memu)然后我通過路由跳轉到其他頁面this.$global.memu卻是undefined created(){ console.log(this.$global.memu)//undefined
},
mounted(){ console.log(this.$global.memu)//undefined
},請問這些操作哪里有問題啊
添加回答
舉報
0/150
提交
取消