From ff1124651116ac3e482b7693e54c2a184a290478 Mon Sep 17 00:00:00 2001 From: xiaozhenzhen <1506678296@qq.com> Date: Sat, 5 Sep 2020 23:33:37 +0800 Subject: [PATCH] fix: Change the options object: remove the `retryWhen`, `maxRetries` attributes, add the `onError` event, and attach a comment --- src/api/global-api.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/api/global-api.md b/src/api/global-api.md index f31af42c88..63758ef47d 100644 --- a/src/api/global-api.md +++ b/src/api/global-api.md @@ -182,12 +182,16 @@ const AsyncComp = defineAsyncComponent({ // The error component will be displayed if a timeout is // provided and exceeded. Default: Infinity. timeout: 3000, - // A function that returns a boolean indicating whether the async component should retry when the loader promise rejects - retryWhen: error => error.code !== 404, - // Maximum allowed retries number - maxRetries: 3, // Defining if component is suspensible - suspensible: false + suspensible: false, + /** + * + * @param {*} error Error message object + * @param {*} retry A function that indicating whether the async component should retry when the loader promise rejects + * @param {*} fail End of failure + * @param {*} attempts Maximum allowed retries number + */ + onError(error, retry, fail, attempts) {}, }) ```