docs(Stepper): fix async change demo (#7703)

This commit is contained in:
neverland 2020-12-07 20:58:40 +08:00 committed by GitHub
parent 2e6b032464
commit af81912210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -88,7 +88,8 @@ export default {
onChange(value) {
Toast.loading({ forbidClick: true });
setTimeout(() => {
clearTimeout(this.timer);
this.timer = setTimeout(() => {
Toast.clear();
this.value = value;
}, 500);

View File

@ -110,9 +110,9 @@ export default {
onChange(value) {
Toast.loading({ forbidClick: true });
setTimeout(() => {
clearTimeout(this.timer);
this.timer = setTimeout(() => {
Toast.clear();
// 注意此时修改 value 后会再次触发 change 事件
this.value = value;
}, 500);

View File

@ -91,7 +91,8 @@ export default {
onChange(value) {
this.$toast.loading({ forbidClick: true });
setTimeout(() => {
clearTimeout(this.timer);
this.timer = setTimeout(() => {
this.stepper6 = value;
this.$toast.clear();
}, 500);