更新记录

1.0.0(2026-04-02) 下载此版本

首次发布

  • 支持 target(结束时间戳 ms)、timeOffset(与服务器对齐)
  • formatauto / dhms / hms / ms
  • 事件:changeend;方法:start / pause / resume / reset(ref)
  • 默认插槽作用域:dhmsremainingMsfinished

平台兼容性

uni-app(3.7.3)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 小红书小程序 快应用-华为 快应用-联盟
- -

sea-countdown

Props

属性 类型 默认值 说明
target Number 0 结束时间戳(毫秒,与 Date.now() 同基准)
timeOffset Number 0 服务器与本地时间差(毫秒):serverTime - Date.now(),用于校正倒计时
format String 'auto' auto:有天显示天;dhms:始终 天 时:分:秒hms:总小时:分:秒;ms:分:秒(适合短倒计时)
separator String ':' 时/分/秒之间的分隔符
finishedText String '已结束' 默认插槽在结束时的文案
showFinished Boolean true 结束后是否仍渲染默认文案(false 时仅插槽可接 finished

Events

事件 参数 说明
change { remainingMs, d, h, m, s, finished } 每秒(约)变化
end { target } 到达结束时间(仅触发一次)

Methods(需 ref)

方法 说明
start() 开始/重新开始(会按当前 target 计算)
pause() 暂停
resume() 继续
reset() 按当前 target 重新计时(修改截止时间请先更新父级 :target

插槽

默认插槽作用域:{ d, h, m, s, remainingMs, finished }hdhms 为当天小时,在 hms 为总小时数由组件内部处理,见组件实现)。

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT License

Copyright (c) [2026] [sea]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

暂无用户评论。