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

feat: app tabbar API 支持 iconfont 属性

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