mui open the page using the problem remains the same id multiple pages within the same page id stack

Every time I open the page using mui.openWindow, caeateNew is false, id: id

But there will be the same page content is not the same problem from time to time in the open page, and finally found the page in multiple page stack memory of the same id

, Racked brain with a stupid way to solve

var views = plus.webview.all (); // get the page stack
the console.log (the JSON.stringify (views))    
var myviews = [] // Create page id set
for (var i = 0; i <views.length ; I ++) {
myviews.push (views [I] .id) // pages to the id

}

var my = []
console.log(myviews)
for(var i=0;i<myviews.length;i++){

// set traverse the page id
IF (myviews [I] == 'personal') {
the console.log (myviews [I])

my.push (myviews [I]) // if id is the personal page, this page id save up all

}
}

if (my.length> 1) {// If the length of the same set page id is greater than 1, it shows a plurality of the same id page, the page is opened first top surface, the most primitive data, need not, destroyed, leaving only the last page id
for (var = E 0; E <-my.length. 1; E ++) {
the console.log (My [E])
plus.webview.close (My [E]);
}
}

mui do not want this thing Tucao, uncomfortable, perhaps with less, this is what a wonderful problem

Guess you like

Origin www.cnblogs.com/lishuang2243/p/12172682.html