Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: countdown组件,在自定义展示样式里不能显示毫秒 #2700

Closed
JasirVoriya opened this issue Nov 29, 2023 · 3 comments
Closed
Labels
Feature Request 新功能请求

Comments

@JasirVoriya
Copy link

NutUI 包名

@nutui/nutui

这个功能解决了什么问题?

countdown在format 格式下,可以支持显示到毫秒,可是在自定义展示样式里,无法显示到毫秒:

<script setup lang="ts">
const end = ref(Date.now() + 60 * 60 * 1000);
const resetTime = ref({
  d: '0',
  h: '00',
  m: '00',
  s: '00',
});
</script>
<template>
  <nut-countdown v-model="resetTime" :end-time="end" millisecond format="HH:mm:ss:SS">
    <span class=" text-sm">
      距离结束还剩:
      <span class=" text-red-600 text-2xl">{{ resetTime.d }}</span>天
      <span class=" text-red-600 text-2xl">{{ resetTime.h }}</span>时
      <span class=" text-red-600 text-2xl">{{ resetTime.m }}</span>分
      <span class=" text-red-600 text-2xl">{{ resetTime.s }}</span>秒
    </span>
  </nut-countdown>
</template>

如上,只能显示到秒,官方文档也没有讲如何显示毫秒

你期望的组件设计是怎样的?

能够在自定义样式里面,显示毫秒

@JasirVoriya JasirVoriya added the Feature Request 新功能请求 label Nov 29, 2023
@eiinu
Copy link
Member

eiinu commented Nov 29, 2023

参考 NutUI Playground
下次发版会把毫秒加到文档演示代码中

@JasirVoriya
Copy link
Author

参考 NutUI Playground 下次发版会把毫秒加到文档演示代码中

请问支持只显示1位毫秒嘛

@eiinu
Copy link
Member

eiinu commented Nov 29, 2023

参考 NutUI Playground 下次发版会把毫秒加到文档演示代码中

请问支持只显示1位毫秒嘛

可以自行对毫秒的原始数据进行格式化展示

@eiinu eiinu closed this as completed Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request 新功能请求
Projects
None yet
Development

No branches or pull requests

2 participants