@@ -12,10 +12,13 @@ import useConfigInject from '../config-provider/hooks/useConfigInject';
12
12
import devWarning from '../vc-util/devWarning' ;
13
13
import { progressProps , progressStatuses } from './props' ;
14
14
import type { VueNode } from '../_util/type' ;
15
+ import useStyle from './style' ;
16
+ import classNames from '../_util/classNames' ;
15
17
16
18
export default defineComponent ( {
17
19
compatConfig : { MODE : 3 } ,
18
20
name : 'AProgress' ,
21
+ inheritAttrs : false ,
19
22
props : initDefaultProps ( progressProps ( ) , {
20
23
type : 'line' ,
21
24
percent : 0 ,
@@ -26,8 +29,9 @@ export default defineComponent({
26
29
strokeLinecap : 'round' ,
27
30
} ) ,
28
31
slots : [ 'format' ] ,
29
- setup ( props , { slots } ) {
32
+ setup ( props , { slots, attrs } ) {
30
33
const { prefixCls, direction } = useConfigInject ( 'progress' , props ) ;
34
+ const [ wrapSSR , hashId ] = useStyle ( prefixCls ) ;
31
35
devWarning (
32
36
props . successPercent == undefined ,
33
37
'Progress' ,
@@ -37,6 +41,7 @@ export default defineComponent({
37
41
const { type, showInfo, size } = props ;
38
42
const pre = prefixCls . value ;
39
43
return {
44
+ [ hashId . value ] : true ,
40
45
[ pre ] : true ,
41
46
[ `${ pre } -${ ( type === 'dashboard' && 'circle' ) || type } ` ] : true ,
42
47
[ `${ pre } -show-info` ] : showInfo ,
@@ -93,6 +98,7 @@ export default defineComponent({
93
98
94
99
return ( ) => {
95
100
const { type, steps, strokeColor, title } = props ;
101
+ const { class : cls , ...restAttrs } = attrs ;
96
102
const progressInfo = renderProcessInfo ( ) ;
97
103
98
104
let progress : VueNode ;
@@ -120,15 +126,14 @@ export default defineComponent({
120
126
) ;
121
127
}
122
128
123
- const classNames = {
124
- ...classString . value ,
129
+ const classes = classNames ( classString . value , {
125
130
[ `${ prefixCls . value } -status-${ progressStatus . value } ` ] : true ,
126
- } ;
131
+ } ) ;
127
132
128
- return (
129
- < div class = { classNames } title = { title } >
133
+ return wrapSSR (
134
+ < div { ... restAttrs } class = { [ classes , cls ] } title = { title } >
130
135
{ progress }
131
- </ div >
136
+ </ div > ,
132
137
) ;
133
138
} ;
134
139
} ,
0 commit comments