@@ -17,6 +17,9 @@ import { computed, defineComponent, toRef } from 'vue';
17
17
import useConfigInject from '../config-provider/hooks/useConfigInject' ;
18
18
import classNames from '../_util/classNames' ;
19
19
20
+ // CSSINJS
21
+ import useStyle from './style' ;
22
+
20
23
type InjectDefaultProps < Props > = Omit <
21
24
Props ,
22
25
'locale' | 'generateConfig' | 'prevIcon' | 'nextIcon' | 'superPrevIcon' | 'superNextIcon'
@@ -117,6 +120,10 @@ function generateCalendar<
117
120
] ,
118
121
setup ( props , { emit, slots, attrs } ) {
119
122
const { prefixCls, direction } = useConfigInject ( 'picker' , props ) ;
123
+
124
+ // style
125
+ const [ wrapSSR , hashId ] = useStyle ( prefixCls ) ;
126
+
120
127
const calendarPrefixCls = computed ( ( ) => `${ prefixCls . value } -calendar` ) ;
121
128
const maybeToString = ( date : DateType ) => {
122
129
return props . valueFormat ? generateConfig . toString ( date , props . valueFormat ) : date ;
@@ -273,7 +280,7 @@ function generateCalendar<
273
280
</ div >
274
281
) ;
275
282
} ;
276
- return (
283
+ return wrapSSR (
277
284
< div
278
285
{ ...attrs }
279
286
class = { classNames (
@@ -284,6 +291,7 @@ function generateCalendar<
284
291
[ `${ calendarPrefixCls . value } -rtl` ] : direction . value === 'rtl' ,
285
292
} ,
286
293
attrs . class ,
294
+ hashId . value ,
287
295
) }
288
296
>
289
297
{ headerRender ? (
@@ -319,7 +327,7 @@ function generateCalendar<
319
327
disabledDate = { mergedDisabledDate . value }
320
328
hideHeader
321
329
/>
322
- </ div >
330
+ </ div > ,
323
331
) ;
324
332
} ;
325
333
} ,
0 commit comments