main
zhuzihcu 2023-04-11 16:30:07 +08:00
parent 3a46fd11c6
commit 51e73e7f8e
2 changed files with 19 additions and 14 deletions

View File

@ -301,20 +301,7 @@ FluObject{
}
function startPageByItem(data){
var items = navigationView.getItems();
for(var i=0;i<items.length;i++){
var item = items[i]
if(item.key === data.key){
if(navigationView.getCurrentIndex() === i){
return
}
navigationView.setCurrentIndex(i)
if(item.parent){
item.parent.isExpand = true
}
return
}
}
navigationView.startPageByItem(data)
}
}

View File

@ -804,6 +804,7 @@ Item {
function setCurrentIndex(index){
nav_list.currentIndex = index
}
function getItems(){
@ -818,4 +819,21 @@ Item {
return nav_list.currentIndex
}
function startPageByItem(data){
var items = getItems();
for(var i=0;i<items.length;i++){
var item = items[i]
if(item.key === data.key){
if(getCurrentIndex() === i){
return
}
setCurrentIndex(i)
if(item.parent && !d.isCompactAndNotPanel){
item.parent.isExpand = true
}
return
}
}
}
}