uni-ui
uni-ui copied to clipboard
:sparkles:feat: feat(uni-countdown): 新增showTime对象参数-控制时分秒的单独显示
这个需求社区反馈的也挺多的:
https://ext.dcloud.net.cn/plugin?name=uni-countdown 希望时分秒也支持开关
只显示秒的用法:
<uni-countdown
:start="start"
:second="40"
:showDay="false"
:showTime="{ hour: false, minute: false }" />
只显示分秒的用法:
<uni-countdown
:start="start"
:second="40"
:showDay="false"
:showTime="{ hour: false }" />
或许可以考虑使用一个变量autoHideLeft
来自动屏蔽左端为0的值.
例如 :0天00小时10分03秒,当:autoHideLeft="true"
显示为:10分03秒
<text v-if="h>0" :style="[timeStyle]" class="uni-countdown__number">{{ h }}</text>
或许可以考虑使用一个变量
autoHideLeft
来自动屏蔽左端为0的值.例如 :0天00小时10分03秒,当
:autoHideLeft="true"
显示为:10分03秒
<text v-if="h>0" :style="[timeStyle]" class="uni-countdown__number">{{ h }}</text>
很好的主意,但是只显示时、只显示分的时候应该就不行了