From 2db375c73fc2a148a364484e21e6c8a37f1b0ee6 Mon Sep 17 00:00:00 2001 From: 刘嘉威 <daidaibg@163.com> Date: 星期一, 17 十月 2022 11:29:49 +0800 Subject: [PATCH] docs: update README --- README.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 60 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 8c017cc..08bc674 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,66 @@ | :---: | :--: | :----: | :----: | :----: | | title | 鏍囧ご | - | string | - | +### CountUp 鏁板瓧婊氬姩 + +浠ヤ笅灞炴�у悓 coutup.js 閰嶇疆椤癸紙same as countup.js properties锛� + +#### Props + +| Name | Type | Default | Description | +| -------- | ---------------- | ------- | ------------------------------------------------------------ | +| endVal | Number \| String | - | 缁撴潫鍊� | +| startVal | Number \| String | 0 | 璧峰鍊� | +| duration | Number | 2.5 | 鍔ㄧ敾鏃堕暱锛屽崟浣嶏細绉� | +| options | Object | - | [countUp.js](https://github.com/inorganik/countUp.js) options 閰嶇疆椤� | + +浠ヤ笅涓虹粍浠剁壒鏈夊睘鎬э紙extension properties锛� + +| Name | Type | Default | Description | +| -------- | ----------------- | ------- | ----------------------------- | +| autoplay | Boolean | true | 鏄惁鑷姩璁℃暟 | +| loop | Boolean \| Number | false | 寰幆娆℃暟锛屾湁闄愭鏁� / 鏃犻檺寰幆 | +| delay | Number | 0 | loop 寰幆鐨勯棿闅旀椂闂达紝鍗曚綅锛氱 | + +#### 鎻掓Ы锛坰lots锛� + +| Name | Description | +| ------ | ----------- | +| prefix | 鍓嶇紑 | +| suffix | 鍚庣紑 | + +#### 浜嬩欢锛圗vents锛� + +| Name | Description | return | +| --------- | -------------------------- | ------------ | +| @init | CountUp 瀹炰緥鍒濆鍖栧畬鎴愯Е鍙� | CountUp 瀹炰緥 | +| @finished | 璁℃暟缁撴潫鏃惰Е鍙� | - | + +#### countup.js 閰嶇疆椤硅鏄� +```ts +interface CountUpOptions { + startVal?: number // number to start at (0) 寮�濮嬫暟鍊硷紝榛樿 0 + decimalPlaces?: number // number of decimal places (0) 灏忔暟鐐� 浣嶆暟 + duration?: number // animation duration in seconds (2) 鍔ㄧ敾鏃堕暱 + useGrouping?: boolean // example: 1,000 vs 1000 (true) 鏄惁浣跨敤鍗冨垎浣� + useEasing?: boolean // ease animation (true) 鏄惁寮�鍚姩鐢昏繃娓★紝榛樿鍔ㄧ敾鍑芥暟涓篹aseOutExpo + smartEasingThreshold?: number // smooth easing for large numbers above this if useEasing (999) + smartEasingAmount?: number // amount to be eased for numbers above threshold (333) + separator?: string // grouping separator (',') 鍗冨垎浣嶅垎闅旂 + decimal?: string // decimal ('.') 灏忔暟鐐瑰垎闅旂 + // easingFn: easing function for animation (easeOutExpo) 鍔ㄧ敾鍑芥暟 + easingFn?: (t: number, b: number, c: number, d: number) => number + formattingFn?: (n: number) => string // this function formats result 鏍煎紡鍖栫粨鏋� + prefix?: string // text prepended to result 鏁板�煎墠缂� + suffix?: string // text appended to result 鏁板�煎悗缂� + numerals?: string[] // numeral glyph substitution 鏁板瓧绗﹀彿鏇挎崲 0 - 9锛屼緥濡傛浛鎹负 [a,b,c,d,e,f,g,h,i,j] + enableScrollSpy?: boolean // start animation when target is in view 鍦ㄥ彲瑙嗚寖鍥村唴鎵嶅紑濮嬪姩鐢� + scrollSpyDelay?: number // delay (ms) after target comes into view 鐩爣杩涘叆鍙鑼冨洿鍐呭悗鐨勫欢杩熸椂闂�(姣) +} +``` + + + ## 涓棿鍦板浘 ### 鍗楁捣鏄鹃殣鎺у埗 -- Gitblit v1.8.0