提交 3a246cf9 编写于 作者: d-u-a's avatar d-u-a

fix: vue2 web tabbar iconfont selectedColor无效问题,仅更新用户传入的属性

上级 67f076f3
......@@ -44,7 +44,7 @@
<div
v-if="item.iconfont"
:style="{
color:selectedIndex === index ? selectedColor : color,
color:selectedIndex === index ? item.iconfont.selectedColor : item.iconfont.color,
fontSize: item.iconfont.fontSize || iconWidth
}"
class="uni-tabbar__iconfont"
......
......@@ -8,6 +8,8 @@ const setTabBarStyleProps = ['color', 'selectedColor', 'backgroundColor', 'borde
const setTabBarBadgeProps = ['badge', 'redDot']
const setTabBarIconfontStyles = ['text', 'selectedText', 'fontSize', 'color', 'selectedColor']
function setTabBar (type, args = {}) {
const app = getApp()
......@@ -43,7 +45,11 @@ function setTabBar (type, args = {}) {
case 'hideTabBar':
app.$children[0].hideTabBar = true
break
case 'setTabBarItem': {
case 'setTabBarItem': {
if (args.iconfont) {
setProperties(tabBar.list[index].iconfont, setTabBarIconfontStyles, args.iconfont)
args.iconfont = tabBar.list[index].iconfont
}
setProperties(tabBar.list[index], setTabBarItemProps, args)
const pagePath = args.pagePath
const route = pagePath && __uniRoutes.find(({ path }) => path === pagePath)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册