umicro / uView2.0

uView UI,是全面兼容nvue的uni-app生态框架,全面的组件和便捷的工具会让您信手拈来,如鱼得水
MIT License
1.51k stars 452 forks source link

配置全局rpx单位后,u-tabbar-item icon图标太小,change事件无法触发 #356

Open vv-lin opened 2 years ago

vv-lin commented 2 years ago

版本

2.0.27

转载链接

www.uviewui.com

重现步骤

问题1:配置全局rpx单位后,u-tabbar-item icon图标太小,大概为9px;问题代码在u-tabbar-item.vue 12行:

<u-icon
     v-if="icon"
     :name="icon"
     :color="isActive? parentData.activeColor : parentData.inactiveColor"
     :size="20" <!-- 这里有问题 -->
></u-icon>

问题2:change事件无法触发

<u-tabbar :value="vuex_tabbar_index">
    <u-tabbar-item v-for="item in vuex_tabber_list" 
        :text="item.text" 
        :icon="item.icon" 
        @change="changeTabbar()">
    </u-tabbar-item>
</u-tabbar>

...
methods: {
    changeTabbar(index) {
        // 不进入这个方法
        this.$u.vuex('vuex_tabbar_index', index)
    }
}

期望的结果是什么?

问题1:期望能够设置全局采用rpx单位后,图标能够正常大小; 问题2:能够正常触发change事件。

实际的结果是什么?

问题1:实际结果是图标太小,大概为9px; 问题2:不触发change事件,但是会触发click事件。


另外,文档写得有点小问题,应该为 Tabbar,实际写的是TableBar Props、TableBarItem Props、TableBarItem Events。 详见:https://www.uviewui.com/components/tabbar.html

yatoku commented 2 years ago

已确认

lycoris-xmin commented 4 months ago

请问这个bug是还没修复吗?

wjw020206 commented 2 months ago

自定义tabBar在使用rpx后icon图标太小的问题在 uview 的 2.0.37 似乎依旧没有解决