update no Stop

This commit is contained in:
熊潇 2025-06-18 14:59:56 +08:00
parent ca154ba883
commit b53968df8b
2 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@kevisual/query",
"version": "0.0.28",
"version": "0.0.29",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -44,6 +44,10 @@ export type Result<S = any> = {
export type DataOpts = Partial<QueryOpts> & {
beforeRequest?: Fn;
afterResponse?: <S = any>(result: Result<S>, ctx?: { req?: any; res?: any; fetch?: any }) => Promise<Result<S>>;
/**
* stop的时候不请求
*/
noStop?: boolean;
};
/**
* , success showError,
@ -171,7 +175,7 @@ export class Query {
req: req,
});
}
if (this.stop) {
if (this.stop && !options?.noStop) {
const that = this;
await new Promise((resolve) => {
let timer = 0;