File tree 2 files changed +10
-10
lines changed
components/vc-picker/hooks
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ export default function usePresets<T>(
8
8
presets ?: ComputedRef < PresetDate < T > [ ] > ,
9
9
legacyRanges ?: ComputedRef < Record < string , T | ( ( ) => T ) > > ,
10
10
) : ComputedRef < PresetDate < T > [ ] > {
11
- if ( presets . value ) {
12
- return presets ;
13
- }
14
- if ( legacyRanges && legacyRanges . value ) {
15
- warning ( false , '`ranges` is deprecated. Please use `presets` instead.' ) ;
11
+ return computed ( ( ) => {
12
+ if ( presets ?. value ) {
13
+ return presets . value ;
14
+ }
15
+ if ( legacyRanges ?. value ) {
16
+ warning ( false , '`ranges` is deprecated. Please use `presets` instead.' ) ;
16
17
17
- return computed ( ( ) => {
18
18
const rangeLabels = Object . keys ( legacyRanges . value ) ;
19
19
return rangeLabels . map ( label => {
20
20
const range = legacyRanges . value [ label ] ;
@@ -24,7 +24,7 @@ export default function usePresets<T>(
24
24
value : newValues ,
25
25
} ;
26
26
} ) ;
27
- } ) ;
28
- }
29
- return [ ] as unknown as ComputedRef < PresetDate < T > [ ] > ;
27
+ }
28
+ return [ ] as unknown as PresetDate < T > [ ] ;
29
+ } ) ;
30
30
}
Original file line number Diff line number Diff line change 7
7
"ant-design-vue/lib/*" : [" components/*" ],
8
8
"ant-design-vue/locale/*" : [" components/locale/*" ]
9
9
},
10
- "lib" : [" dom " , " es2017 " ],
10
+ "lib" : [" DOM " , " ESNext " ],
11
11
"strictNullChecks" : false ,
12
12
"moduleResolution" : " node" ,
13
13
"esModuleInterop" : true ,
You can’t perform that action at this time.
0 commit comments