1
- import { provide , nextTick , defineComponent , ref , watch , onBeforeMount } from 'vue' ;
1
+ import { provide , nextTick , defineComponent , ref , watch } from 'vue' ;
2
2
import type { PropType , ExtractPropTypes } from 'vue' ;
3
3
import classNames from '../_util/classNames' ;
4
4
import PropTypes from '../_util/vue-types' ;
@@ -44,8 +44,8 @@ export default defineComponent({
44
44
emits : [ 'update:value' , 'change' ] ,
45
45
setup ( props , { slots, emit } ) {
46
46
const formItemContext = useInjectFormItemContext ( ) ;
47
- const { prefixCls } = useConfigInject ( 'radio' , props ) ;
48
- const stateValue = ref ( props . value === undefined ? props . defaultValue : props . value ) ;
47
+ const { prefixCls, direction , size } = useConfigInject ( 'radio' , props ) ;
48
+ const stateValue = ref ( props . value ) ;
49
49
const updatingValue = ref < boolean > ( false ) ;
50
50
watch (
51
51
( ) => props . value ,
@@ -73,7 +73,7 @@ export default defineComponent({
73
73
updatingValue . value = false ;
74
74
} ) ;
75
75
} ;
76
-
76
+
77
77
provide ( 'radioGroupContext' , {
78
78
onRadioChange,
79
79
stateValue,
@@ -86,7 +86,8 @@ export default defineComponent({
86
86
const groupPrefixCls = `${ prefixCls . value } -group` ;
87
87
88
88
const classString = classNames ( groupPrefixCls , `${ groupPrefixCls } -${ buttonStyle } ` , {
89
- [ `${ groupPrefixCls } -${ props . size } ` ] : props . size ,
89
+ [ `${ groupPrefixCls } -${ size . value } ` ] : size . value ,
90
+ [ `${ groupPrefixCls } -rtl` ] : direction . value === 'rtl' ,
90
91
} ) ;
91
92
92
93
let children = null ;
0 commit comments