if(typeof(this.$route.query.result)=='string'){ //刷新時走這 }else{
//正常路由跳轉過來后就把數據塞到 localStorage let obj = JSON.stringify(this.$route.query); //轉化為JSON字符串 localStorage.setItem("prizeResult", obj); //數據存storage,防止刷新丟失 }
去localStorage取 let result = JSON.parse(localStorage.getItem("prizeResult")); //對自己的業務邏輯進行處理 this.showAll(result);
各位老鐵, 走過路過,覺得OK麻煩點下推薦,謝謝!