提交 91f75d1e 编写于 作者: d-u-a's avatar d-u-a

feat: app tabbar API 支持 iconfont 属性

上级 63dc9712
......@@ -21,9 +21,10 @@ export function setTabBarItem ({
iconPath,
selectedIconPath,
pagePath,
visible
visible,
iconfont
}) {
tabBar.setTabBarItem(index, text, iconPath, selectedIconPath, visible)
tabBar.setTabBarItem(index, text, iconPath, selectedIconPath, visible, iconfont)
const route = pagePath && __uniRoutes.find(({ path }) => path === pagePath)
if (route) {
const meta = route.meta
......
......@@ -49,7 +49,7 @@ function setTabBarBadge (type, index, text) {
/**
* 动态设置 tabBar 某一项的内容
*/
function setTabBarItem (index, text, iconPath, selectedIconPath, visible) {
function setTabBarItem (index, text, iconPath, selectedIconPath, visible, iconfont) {
const item = {
index
}
......@@ -61,6 +61,9 @@ function setTabBarItem (index, text, iconPath, selectedIconPath, visible) {
}
if (selectedIconPath) {
item.selectedIconPath = getRealPath(selectedIconPath)
}
if (iconfont !== undefined) {
item.iconfont = iconfont
}
if (visible !== undefined) {
item.visible = config.list[index].visible = visible
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册