From b53968df8b1f2c3dc101f51a34f5c7526d406b71 Mon Sep 17 00:00:00 2001 From: xion Date: Wed, 18 Jun 2025 14:59:56 +0800 Subject: [PATCH] update no Stop --- package.json | 2 +- src/query.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3a2a2ce..446ad3a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/query.ts b/src/query.ts index 3a9410f..e7b7ad0 100644 --- a/src/query.ts +++ b/src/query.ts @@ -44,6 +44,10 @@ export type Result = { export type DataOpts = Partial & { beforeRequest?: Fn; afterResponse?: (result: Result, ctx?: { req?: any; res?: any; fetch?: any }) => Promise>; + /** + * 是否在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;