Skip to content

feat(Timer): add new Timer component - #13883

Open
zehuichan wants to merge 2 commits into
youzan:mainfrom
zehuichan:feat/timer
Open

feat(Timer): add new Timer component#13883
zehuichan wants to merge 2 commits into
youzan:mainfrom
zehuichan:feat/timer

Conversation

@zehuichan

Copy link
Copy Markdown

Summary

  • Add Timer component for real-time elapsed (count-up) display, mirroring CountDown API and docs patterns
  • Add @vant/use useTimer composable with optional maxTime support
  • Cover unit tests, bilingual docs, demo, theme vars, and site nav registration

Test plan

  • pnpm --dir ./packages/vant-use build
  • pnpm exec rstest run src/timer/test/index.spec.tsx (in packages/vant)
  • pnpm dev and verify Timer demo (basic / format / millisecond / max-time / custom style / manual control)
  • Confirm docs pages: Timer (zh/en) and useTimer (zh/en) render in the site nav

Made with Cursor

Add a count-up Timer component and useTimer composable, mirroring CountDown with optional max-time support.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.44%. Comparing base (ec5b45b) to head (53d6736).
⚠️ Report is 282 commits behind head on main.

Files with missing lines Patch % Lines
packages/vant/src/timer/Timer.tsx 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13883      +/-   ##
==========================================
- Coverage   89.60%   89.44%   -0.17%     
==========================================
  Files         257      260       +3     
  Lines        7013     6734     -279     
  Branches     1736     1684      -52     
==========================================
- Hits         6284     6023     -261     
+ Misses        384      376       -8     
+ Partials      345      335      -10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants