Skip to content

Commit 182c6e4

Browse files
committed
📝 docs: update changelogs and improve documentation in README.md
1 parent 74f2805 commit 182c6e4

File tree

2 files changed

+60
-48
lines changed

2 files changed

+60
-48
lines changed

packages/core/README.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
[![License](https://img.shields.io/github/license/OFreshman/ui-utils-kit.svg?style=flat&colorA=080f12&colorB=1fa669)](https://github.com/OFreshman/ui-utils-kit/blob/main/LICENSE)
1212

1313
---
14-
## 📖changelogs
14+
## 📝 changelogs
15+
### TodoList
16+
- `bussiness.captureElementAsImage` 支持 html-to-image 的 选择?
17+
---
1518
- 2024-12-06
1619
- 新增 `tree` 模块,提供树形数据操作的工具函数。
1720
- 新增 `business` 模块,提供 DOM 转图片的工具函数。
@@ -21,6 +24,9 @@
2124
- 新增 `common.createSelfCorrectingClock` 创建零漂移的自校正实时时钟。
2225
- 新增 `common.createSelfCorrectingCountdown` 创建零漂移的自校正倒计时器。
2326
- 完善文档说明。
27+
- 2025-05-08
28+
- 依赖集中在 `pnpm-workspace.yaml - catalogs` 统一管理。
29+
- 完善文档说明。
2430

2531
## 📌 简介
2632

@@ -278,30 +284,30 @@ console.log(desensitize('110105199001011234', 'idcard')); // 输出:110105****
278284
</template>
279285
280286
<script setup lang="ts">
281-
import { Mutex } from 'ui-utils-kit'
282-
283-
// 状态变量,无需在 setup 中 return,自动暴露给模板使用
284-
const isSubmitting = ref(false)
285-
// 创建一个互斥锁实例
286-
const submitMutex = new Mutex()
287-
288-
// 点击处理函数
289-
const onSubmit = async () => {
290-
// 获取锁:若已有操作在进行,则挂起后续调用
291-
await submitMutex.lock()
292-
try {
293-
isSubmitting.value = true
294-
// 模拟网络请求
295-
await new Promise<void>(resolve => setTimeout(resolve, 1500))
296-
uni.showToast({ title: '提交成功' })
297-
} catch (err: any) {
298-
uni.showModal({ title: '错误', content: err.message })
299-
} finally {
300-
isSubmitting.value = false
301-
// 释放锁,允许下一次点击
302-
submitMutex.unlock()
287+
import { Mutex } from 'ui-utils-kit'
288+
289+
// 状态变量,无需在 setup 中 return,自动暴露给模板使用
290+
const isSubmitting = ref(false)
291+
// 创建一个互斥锁实例
292+
const submitMutex = new Mutex()
293+
294+
// 点击处理函数
295+
const onSubmit = async () => {
296+
// 获取锁:若已有操作在进行,则挂起后续调用
297+
await submitMutex.lock()
298+
try {
299+
isSubmitting.value = true
300+
// 模拟网络请求
301+
await new Promise<void>(resolve => setTimeout(resolve, 1500))
302+
uni.showToast({ title: '提交成功' })
303+
} catch (err: any) {
304+
uni.showModal({ title: '错误', content: err.message })
305+
} finally {
306+
isSubmitting.value = false
307+
// 释放锁,允许下一次点击
308+
submitMutex.unlock()
309+
}
303310
}
304-
}
305311
</script>
306312
```
307313

playground/README.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
[![License](https://img.shields.io/github/license/OFreshman/ui-utils-kit.svg?style=flat&colorA=080f12&colorB=1fa669)](https://github.com/OFreshman/ui-utils-kit/blob/main/LICENSE)
1212

1313
---
14-
## 📖changelogs
14+
## 📝 changelogs
15+
### TodoList
16+
- `bussiness.captureElementAsImage` 支持 html-to-image 的 选择?
17+
---
1518
- 2024-12-06
1619
- 新增 `tree` 模块,提供树形数据操作的工具函数。
1720
- 新增 `business` 模块,提供 DOM 转图片的工具函数。
@@ -21,6 +24,9 @@
2124
- 新增 `common.createSelfCorrectingClock` 创建零漂移的自校正实时时钟。
2225
- 新增 `common.createSelfCorrectingCountdown` 创建零漂移的自校正倒计时器。
2326
- 完善文档说明。
27+
- 2025-05-08
28+
- 依赖集中在 `pnpm-workspace.yaml - catalogs` 统一管理。
29+
- 完善文档说明。
2430

2531
## 📌 简介
2632

@@ -278,30 +284,30 @@ console.log(desensitize('110105199001011234', 'idcard')); // 输出:110105****
278284
</template>
279285
280286
<script setup lang="ts">
281-
import { Mutex } from 'ui-utils-kit'
282-
283-
// 状态变量,无需在 setup 中 return,自动暴露给模板使用
284-
const isSubmitting = ref(false)
285-
// 创建一个互斥锁实例
286-
const submitMutex = new Mutex()
287-
288-
// 点击处理函数
289-
const onSubmit = async () => {
290-
// 获取锁:若已有操作在进行,则挂起后续调用
291-
await submitMutex.lock()
292-
try {
293-
isSubmitting.value = true
294-
// 模拟网络请求
295-
await new Promise<void>(resolve => setTimeout(resolve, 1500))
296-
uni.showToast({ title: '提交成功' })
297-
} catch (err: any) {
298-
uni.showModal({ title: '错误', content: err.message })
299-
} finally {
300-
isSubmitting.value = false
301-
// 释放锁,允许下一次点击
302-
submitMutex.unlock()
287+
import { Mutex } from 'ui-utils-kit'
288+
289+
// 状态变量,无需在 setup 中 return,自动暴露给模板使用
290+
const isSubmitting = ref(false)
291+
// 创建一个互斥锁实例
292+
const submitMutex = new Mutex()
293+
294+
// 点击处理函数
295+
const onSubmit = async () => {
296+
// 获取锁:若已有操作在进行,则挂起后续调用
297+
await submitMutex.lock()
298+
try {
299+
isSubmitting.value = true
300+
// 模拟网络请求
301+
await new Promise<void>(resolve => setTimeout(resolve, 1500))
302+
uni.showToast({ title: '提交成功' })
303+
} catch (err: any) {
304+
uni.showModal({ title: '错误', content: err.message })
305+
} finally {
306+
isSubmitting.value = false
307+
// 释放锁,允许下一次点击
308+
submitMutex.unlock()
309+
}
303310
}
304-
}
305311
</script>
306312
```
307313

0 commit comments

Comments
 (0)