mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs: change tab's 'Before Change' into a real async function (#12693)
This commit is contained in:
parent
39291ee79a
commit
942b190e07
@ -219,7 +219,7 @@ export default {
|
|||||||
|
|
||||||
// async
|
// async
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
resolve(index !== 3);
|
setTimeout(() => resolve(index !== 3), 1000);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ export default {
|
|||||||
// 返回 Promise 来执行异步逻辑
|
// 返回 Promise 来执行异步逻辑
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
// 在 resolve 函数中返回 true 或 false
|
// 在 resolve 函数中返回 true 或 false
|
||||||
resolve(index !== 3);
|
setTimeout(() => resolve(index !== 3), 1000);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ const beforeChange = (name: number) => {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return new Promise<boolean>((resolve) => {
|
return new Promise<boolean>((resolve) => {
|
||||||
resolve(name !== 3);
|
setTimeout(() => resolve(name !== 3), 1000);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user