2022-05-21 08:29:11 +00:00
|
|
|
import { defineComponent } from 'vue';
|
2021-06-26 01:35:40 +00:00
|
|
|
import Radio, { radioProps } from './Radio';
|
2021-10-01 06:53:37 +00:00
|
|
|
import useConfigInject from '../_util/hooks/useConfigInject';
|
2022-05-21 08:29:11 +00:00
|
|
|
import { useProvideRadioOptionTypeContext } from './context';
|
2018-09-05 13:28:54 +00:00
|
|
|
|
2020-10-13 11:02:03 +00:00
|
|
|
export default defineComponent({
|
2018-09-05 13:28:54 +00:00
|
|
|
name: 'ARadioButton',
|
2022-03-26 14:52:54 +00:00
|
|
|
props: radioProps(),
|
|
|
|
setup(props, { slots }) {
|
2021-10-01 06:53:37 +00:00
|
|
|
const { prefixCls } = useConfigInject('radio-button', props);
|
2022-05-21 08:29:11 +00:00
|
|
|
useProvideRadioOptionTypeContext('button');
|
2021-10-01 06:53:37 +00:00
|
|
|
return () => {
|
2022-05-21 08:29:11 +00:00
|
|
|
return (
|
2022-05-22 08:39:57 +00:00
|
|
|
<Radio {...props} prefixCls={prefixCls.value}>
|
2022-05-21 08:29:11 +00:00
|
|
|
{slots.default?.()}
|
|
|
|
</Radio>
|
|
|
|
);
|
2019-05-28 03:37:38 +00:00
|
|
|
};
|
2018-09-05 13:28:54 +00:00
|
|
|
},
|
2020-10-13 11:02:03 +00:00
|
|
|
});
|