在列表頁使用vue傳值給詳情頁后,詳情頁中又增加了新的數據請求vue渲染,但是返回后打開另一個詳情頁vue數據還在,沒有重置,vm數據重置了,但是再次請求的item數據還在,依舊重復使用。//窗口隱藏時,重置頁面數據mui.plusReady(function(){varself=plus.webview.currentWebview();self.addEventListener("hide",function(e){window.scrollTo(0,0);vm.resetData();},false);});這是頁面vm數據的重置代碼,怎么重置item數據呢?varnews=newVue({el:'#news',data:{items:[],//列表信息流數據},functionconvert(items){varnewItems=[];items.forEach(function(item){newItems.push({id:item.id,useride:item.useride,fukanid:item.fukanid,pingtime:item.pingime,avatars:'http://werd.imwork.net:90/public/'+item.avatars,time:getDateDiff(item.pingtime),usernames:item.usernames,pingcongtent:item.pingcongtent,});});returnnewItems;};這是新的vue請求數據,請問怎么點擊返回后將item的數據也重置呢??
vue返回后重置頁面數據
森林海
2019-05-12 14:02:38