Skip to content

Commit 72c62ef

Browse files
fix: remove deep watcher option (#22)
Co-authored-by: Reynold <zhoushunshun@tars-ai.com>
1 parent c3b176d commit 72c62ef

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,13 @@ Axle provides the usage of Vue Composition API style, which encapsulates the `lo
328328
abortOnUnmount: false,
329329
// Whether the value needs to be reset before requesting, defaults false
330330
resetValue: true,
331+
// Automatically reload when reactive inputs change
332+
// When set to true, watch all inputs (params, config, pathParams)
333+
// When set to an object, watch specific inputs:
334+
// - params: true - watch params changes
335+
// - pathParams: true - watch pathParams changes (for API definitions)
336+
// - config: true - watch config changes
337+
watch: true,
331338
// Whether to clone when resetting value, defaults false
332339
// When set to true, use JSON.parse(JSON.stringify(value)) cloned
333340
// When set to a function, the set function will be used as the clone function, such as v => _.cloneDeep(v)

README.zh-CN.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,13 @@ Axle 提供了 Vue Composition API 风格的用法,封装了请求的 `加载
328328
abortOnUnmount: false,
329329
// 请求前是否需要重置 value, 默认值: false
330330
resetValue: true,
331+
// 监听响应式参数变化时自动重新加载
332+
// 设置为 true 时,监听所有参数变化 (params, config, pathParams)
333+
// 设置为对象时,监听指定参数变化:
334+
// - params: true - 监听 params 参数变化
335+
// - pathParams: true - 监听 pathParams 变化(用于 API 定义)
336+
// - config: true - 监听 config 配置变化
337+
watch: true,
331338
// 重置 value 是否对 value 进行拷贝
332339
// 设置为 true 时, 使用 JSON.parse(JSON.stringify(value)) 进行拷贝
333340
// 设置为一个函数时, 该函数将作为拷贝函数对 value 进行拷贝, 如 v => _.cloneDeep(v)

packages/axle/src/use.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ export function createUseAxle(options: CreateUseAxleOptions) {
367367
() => {
368368
runWithInitialConfig()
369369
},
370-
{ deep: true },
371370
)
372371
}
373372
}

0 commit comments

Comments
 (0)