fix: the button's loading property without delay (#3194)
Co-authored-by: caiyong <caiyong@ihomefnt.com>pull/3206/head
parent
8da63a6a24
commit
87e59853bb
|
@ -27,12 +27,13 @@ export default defineComponent({
|
||||||
large: 'lg',
|
large: 'lg',
|
||||||
small: 'sm',
|
small: 'sm',
|
||||||
},
|
},
|
||||||
sLoading: !!this.loading,
|
sLoading: false,
|
||||||
hasTwoCNChar: false,
|
hasTwoCNChar: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
loading(val, preVal) {
|
loading: {
|
||||||
|
handler(val, preVal) {
|
||||||
if (preVal && typeof preVal !== 'boolean') {
|
if (preVal && typeof preVal !== 'boolean') {
|
||||||
clearTimeout(this.delayTimeout);
|
clearTimeout(this.delayTimeout);
|
||||||
}
|
}
|
||||||
|
@ -44,6 +45,8 @@ export default defineComponent({
|
||||||
this.sLoading = !!val;
|
this.sLoading = !!val;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fixTwoCNChar();
|
this.fixTwoCNChar();
|
||||||
|
|
Loading…
Reference in New Issue