1- import { provide , nextTick , defineComponent , ref , watch , onBeforeMount } from 'vue' ;
1+ import { provide , nextTick , defineComponent , ref , watch } from 'vue' ;
22import type { PropType , ExtractPropTypes } from 'vue' ;
33import classNames from '../_util/classNames' ;
44import PropTypes from '../_util/vue-types' ;
@@ -44,8 +44,8 @@ export default defineComponent({
4444 emits : [ 'update:value' , 'change' ] ,
4545 setup ( props , { slots, emit } ) {
4646 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 ) ;
4949 const updatingValue = ref < boolean > ( false ) ;
5050 watch (
5151 ( ) => props . value ,
@@ -73,7 +73,7 @@ export default defineComponent({
7373 updatingValue . value = false ;
7474 } ) ;
7575 } ;
76-
76+
7777 provide ( 'radioGroupContext' , {
7878 onRadioChange,
7979 stateValue,
@@ -86,7 +86,8 @@ export default defineComponent({
8686 const groupPrefixCls = `${ prefixCls . value } -group` ;
8787
8888 const classString = classNames ( groupPrefixCls , `${ groupPrefixCls } -${ buttonStyle } ` , {
89- [ `${ groupPrefixCls } -${ props . size } ` ] : props . size ,
89+ [ `${ groupPrefixCls } -${ size . value } ` ] : size . value ,
90+ [ `${ groupPrefixCls } -rtl` ] : direction . value === 'rtl' ,
9091 } ) ;
9192
9293 let children = null ;
0 commit comments