File tree 1 file changed +14
-11
lines changed
1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -27,22 +27,25 @@ export default defineComponent({
27
27
large : 'lg' ,
28
28
small : 'sm' ,
29
29
} ,
30
- sLoading : ! ! this . loading ,
30
+ sLoading : false ,
31
31
hasTwoCNChar : false ,
32
32
} ;
33
33
} ,
34
34
watch : {
35
- loading ( val , preVal ) {
36
- if ( preVal && typeof preVal !== 'boolean' ) {
37
- clearTimeout ( this . delayTimeout ) ;
38
- }
39
- if ( val && typeof val !== 'boolean' && val . delay ) {
40
- this . delayTimeout = setTimeout ( ( ) => {
35
+ loading : {
36
+ handler ( val , preVal ) {
37
+ if ( preVal && typeof preVal !== 'boolean' ) {
38
+ clearTimeout ( this . delayTimeout ) ;
39
+ }
40
+ if ( val && typeof val !== 'boolean' && val . delay ) {
41
+ this . delayTimeout = setTimeout ( ( ) => {
42
+ this . sLoading = ! ! val ;
43
+ } , val . delay ) ;
44
+ } else {
41
45
this . sLoading = ! ! val ;
42
- } , val . delay ) ;
43
- } else {
44
- this . sLoading = ! ! val ;
45
- }
46
+ }
47
+ } ,
48
+ immediate : true ,
46
49
} ,
47
50
} ,
48
51
mounted ( ) {
You can’t perform that action at this time.
0 commit comments