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){ function startPageByItem(data){
var items = navigationView.getItems(); navigationView.startPageByItem(data)
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
}
}
} }
} }

View File

@ -804,6 +804,7 @@ Item {
function setCurrentIndex(index){ function setCurrentIndex(index){
nav_list.currentIndex = index nav_list.currentIndex = index
} }
function getItems(){ function getItems(){
@ -818,4 +819,21 @@ Item {
return nav_list.currentIndex 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
}
}
}
} }