element-plus/packages/hooks
chenweiyi 3eb734ccc4
feat(components): [skeleton] throttle supports values ​​as object (#17041)
* fix(components): [skeleton] `throttle` property not working

* fix: lint fix

* feat: add func & doc & test

* feat: remove test modify

* feat: increase document examples, improve document descriptions

* fix(components): [skeleton] `throttle` property not working

* fix: lint fix

* feat: add func & doc & test

* feat: remove test modify

* feat: increase document examples, improve document descriptions

* feat: 重构`useThrottleRender`钩子以提高代码可读性和效率

- 简化了对`throttle`参数的判断逻辑,通过`isNumber`函数判断是否为数字
- 将`leadingDispatch`和`trailingDispatch`函数合并为`dispatcher`函数,根据传入的类型判断执行逻辑
- 优化了`watch`回调函数,使用`dispatcher`函数替代重复的判断逻辑

* feat: 写法优化

* feat: 引入`isObject`函数替代原有的`typeof throttle === 'object'`判断方式

* feat: 优化骨架屏文档结构和示例

* feat: 完善文字描述和修改对应的文件名

* Update docs/en-US/component/skeleton.md

Co-authored-by: btea <2356281422@qq.com>

* Update docs/en-US/component/skeleton.md

Co-authored-by: btea <2356281422@qq.com>

* feat: Optimize code writing

* Update docs/en-US/component/skeleton.md

Co-authored-by: btea <2356281422@qq.com>

* Update docs/en-US/component/skeleton.md

* feat: modify doc

* feat: md

* feat: 补充 useThrottleRender 钩子的测试用例

* feat: 将 SkeletonThrottle 类型移动到hook中, 重命名为 ThrottleType 以提高通用性

---------

Co-authored-by: btea <2356281422@qq.com>
2024-11-07 21:31:16 +08:00
..
__tests__ feat(components): [skeleton] throttle supports values ​​as object (#17041) 2024-11-07 21:31:16 +08:00
use-aria feat(hooks): add use-aria hooks (#16598) 2024-04-23 13:56:44 +08:00
use-attrs feat(components): [date-picker] work with modal focus trap; a11y controls and attributes (#7598) 2022-05-10 21:51:17 +08:00
use-composition refactor(hooks): rewrite composition as a composable function (#14240) 2024-07-28 21:11:20 +08:00
use-cursor perf(hooks): replace the ref object with a plain object (#15061) 2024-07-28 18:22:44 +08:00
use-delayed-toggle fix(hooks): [use-delayed-toggle] clear timer when call onClose (#12056) 2023-03-16 22:29:24 +08:00
use-deprecated refactor(components): [switch] deprecate value prop (#8335) 2022-06-18 13:48:02 +08:00
use-draggable fix(components): [dialog] rename resetPostion to resetPosition (#17900) 2024-08-21 22:34:12 +08:00
use-empty-values fix(hooks): cannot access 'useEmptyValuesProps' before initialization (#17448) 2024-07-09 19:02:05 +08:00
use-escape-keydown refactor: extract isClient and isNumber isBoolean (#12504) 2023-04-20 20:00:49 +08:00
use-floating refactor: extract isClient and isNumber isBoolean (#12504) 2023-04-20 20:00:49 +08:00
use-focus refactor(components): popper composables (#5035) 2022-01-04 09:15:15 +08:00
use-focus-controller fix: the disabled state should not trigger focus (#18108) 2024-08-31 19:48:48 +08:00
use-forward-ref fix(hooks): type error (#7941) 2022-05-30 09:26:14 +08:00
use-id fix(hooks): [useId] SSR hydration error caused by id in vue@3.5+ (#18647) 2024-10-27 15:49:43 +08:00
use-intermediate-render chore: add eslint rule sort imports (#6823) 2022-03-25 15:35:56 +08:00
use-locale fix(components): [global-config] (#11847) 2023-03-06 23:20:21 +08:00
use-lockscreen fix(hooks): [lockscreen] compatible with document non-existence (#18445) 2024-10-04 21:59:47 +08:00
use-modal chore: enhance eslint rules (#6476) 2022-03-08 14:03:32 +08:00
use-model-toggle refactor: import shared utilities from @element-plus/utils (#18048) 2024-08-29 09:04:03 +08:00
use-namespace chore: prevent warnings while running test cases (#12189) 2023-07-22 23:19:33 +08:00
use-ordered-children fix(components): [tabs] optimize SSR (#15183) 2024-07-29 18:01:07 +08:00
use-popper fix(components): [tooltip] display tooltip correctly (#11643) 2023-02-22 12:27:48 +00:00
use-popper-container fix(hooks): rendering multiple popper container DOM in SSR/SSG (#18482) 2024-10-11 09:49:23 +08:00
use-prevent-global refactor(hooks): refactor hooks (#4253) 2021-11-29 15:58:44 +08:00
use-prop fix(hooks): vm may be null (#12058) 2023-03-16 21:31:16 +08:00
use-same-target refactor: import shared utilities from @element-plus/utils (#18048) 2024-08-29 09:04:03 +08:00
use-size fix(components): circular referencing issue (#11777) 2023-03-01 16:44:09 +08:00
use-teleport refactor: import shared utilities from @element-plus/utils (#18048) 2024-08-29 09:04:03 +08:00
use-throttle-render feat(components): [skeleton] throttle supports values ​​as object (#17041) 2024-11-07 21:31:16 +08:00
use-timeout refactor(hooks): refactor hooks (#4253) 2021-11-29 15:58:44 +08:00
use-transition-fallthrough refactor(hooks): refactor hooks (#4253) 2021-11-29 15:58:44 +08:00
use-z-index fix(hooks): SSR hydration error caused by z-index (#16175) 2024-03-22 16:36:25 +08:00
index.ts refactor(hooks): rewrite composition as a composable function (#14240) 2024-07-28 21:11:20 +08:00
package.json feat: extract eslint config to separate package (#6495) 2022-03-10 15:39:13 +08:00