zzz-pc-view 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.es.js +12 -7
- package/src/index.umd.js +2 -2
package/package.json
CHANGED
package/src/index.es.js
CHANGED
|
@@ -2164,10 +2164,10 @@ const useRequestUtil = (endableLoadStatus) => {
|
|
|
2164
2164
|
// 将 abort 方法添加到响应对象中
|
|
2165
2165
|
abort,
|
|
2166
2166
|
/**
|
|
2167
|
-
*
|
|
2167
|
+
* 定义一个异步方法,用于发送请求并处理响应。
|
|
2168
2168
|
* 这个方法会发送一个 HTTP 请求,并根据请求的结果调用相应的回调函数。
|
|
2169
2169
|
* @method requestData
|
|
2170
|
-
* @param {
|
|
2170
|
+
* @param {httpRequest.HttpRequestPromise} httpRequestPromise - 一个继承自 httpRequest.HttpRequestPromise 的泛型类型,表示 HTTP 请求对象。
|
|
2171
2171
|
* @param {Function} [final] - 一个可选的函数,用于在请求完成后执行最终操作。
|
|
2172
2172
|
* @returns {Promise<T extends httpRequest.HttpRequestPromise<infer R> ? R : never>} - 一个返回值为请求结果的 Promise。
|
|
2173
2173
|
* @description 这个方法会在请求开始时调用 abort 方法,以取消之前的请求。
|
|
@@ -2180,16 +2180,18 @@ const useRequestUtil = (endableLoadStatus) => {
|
|
|
2180
2180
|
abort();
|
|
2181
2181
|
setLoadStatus(true);
|
|
2182
2182
|
request = httpRequestPromise;
|
|
2183
|
+
let isAbort = false;
|
|
2183
2184
|
try {
|
|
2184
2185
|
return await request;
|
|
2185
2186
|
} catch (err) {
|
|
2187
|
+
if (err.code === ABORTED_CODE) {
|
|
2188
|
+
isAbort = true;
|
|
2189
|
+
}
|
|
2186
2190
|
throw err;
|
|
2187
2191
|
} finally {
|
|
2188
2192
|
setLoadStatus(false);
|
|
2189
|
-
|
|
2190
|
-
if (request) {
|
|
2193
|
+
if (!isAbort) {
|
|
2191
2194
|
request = void 0;
|
|
2192
|
-
isAbort = true;
|
|
2193
2195
|
}
|
|
2194
2196
|
final == null ? void 0 : final(isAbort);
|
|
2195
2197
|
}
|
|
@@ -9684,12 +9686,15 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
9684
9686
|
const props = __props;
|
|
9685
9687
|
const mappingComputed = useMappingOption(props, void 0, void 0);
|
|
9686
9688
|
return (_ctx, _cache) => {
|
|
9687
|
-
return props.component ? (openBlock(), createBlock(resolveDynamicComponent(unref(mappingComputed).is), {
|
|
9689
|
+
return props.component ? (openBlock(), createBlock(resolveDynamicComponent(unref(mappingComputed).is), {
|
|
9690
|
+
key: 0,
|
|
9691
|
+
value: _ctx.model[_ctx.prop]
|
|
9692
|
+
}, {
|
|
9688
9693
|
default: withCtx(() => [
|
|
9689
9694
|
createTextVNode(toDisplayString(unref(mappingComputed).text), 1)
|
|
9690
9695
|
]),
|
|
9691
9696
|
_: 1
|
|
9692
|
-
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
9697
|
+
}, 8, ["value"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
9693
9698
|
createTextVNode(toDisplayString(unref(mappingComputed).text), 1)
|
|
9694
9699
|
], 64));
|
|
9695
9700
|
};
|