docs: change tab's 'Before Change' into a real async function (#12693)

This commit is contained in:
Gomi 2024-03-16 11:12:20 +08:00 committed by GitHub
parent 39291ee79a
commit 942b190e07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -219,7 +219,7 @@ export default {
// async
return new Promise((resolve) => {
resolve(index !== 3);
setTimeout(() => resolve(index !== 3), 1000);
});
};

View File

@ -231,7 +231,7 @@ export default {
// 返回 Promise 来执行异步逻辑
return new Promise((resolve) => {
// 在 resolve 函数中返回 true 或 false
resolve(index !== 3);
setTimeout(() => resolve(index !== 3), 1000);
});
};

View File

@ -65,7 +65,7 @@ const beforeChange = (name: number) => {
return false;
}
return new Promise<boolean>((resolve) => {
resolve(name !== 3);
setTimeout(() => resolve(name !== 3), 1000);
});
};
</script>