Skip to main content

bn.setTabBarItemList

setTabBarItemList(options): Promise<{}>

description Dynamic set the tabbar list of mini program. The list parameter must be configure in the tabBar attribute in app.json.

example

bn.setTabBarItemList({
list: ['/pages/index/index', '/pages/logs/logs'],
selectedIndex: 0,
})

Parameters

NameType
optionsTabBarItemListOptions

Returns

Promise<{}>

TabBarItemListOptions

Ƭ TabBarItemListOptions: Object

Type declaration

NameTypeDescription
liststring[]List accepts an array and can only configure a minimum of 2 and a maximum of 5 tabs. Tab is sorted in the order of the array. Each item is a page path, which must have been configured in the list of tabBar attribute in app.json.
selectedIndex?numberSet the selected index of the current tab. If it is not passed, the first tab in the list will be selected.