perf: modal and drawer api support chain calls (#5351)

* perf: modal and drawer api support chain calls

* fix: typo
This commit is contained in:
Netfan
2025-01-11 10:56:54 +08:00
committed by GitHub
parent b8bffd884c
commit 1a04a05b79
10 changed files with 57 additions and 55 deletions

View File

@@ -141,6 +141,7 @@ export class DrawerApi {
setData<T>(payload: T) {
this.sharedData.payload = payload;
return this;
}
setState(
@@ -153,5 +154,6 @@ export class DrawerApi {
} else {
this.store.setState((prev) => ({ ...prev, ...stateOrFn }));
}
return this;
}
}

View File

@@ -151,6 +151,7 @@ export class ModalApi {
setData<T>(payload: T) {
this.sharedData.payload = payload;
return this;
}
setState(
@@ -163,5 +164,6 @@ export class ModalApi {
} else {
this.store.setState((prev) => ({ ...prev, ...stateOrFn }));
}
return this;
}
}