mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
34 lines
701 B
JavaScript
34 lines
701 B
JavaScript
import { createNamespace } from '../utils';
|
|
import { FieldMixin } from '../mixins/field';
|
|
import { ParentMixin } from '../mixins/relation';
|
|
|
|
const [createComponent, bem] = createNamespace('radio-group');
|
|
|
|
export default createComponent({
|
|
mixins: [ParentMixin('vanRadio'), FieldMixin],
|
|
|
|
props: {
|
|
disabled: Boolean,
|
|
direction: String,
|
|
modelValue: null,
|
|
checkedColor: String,
|
|
iconSize: [Number, String],
|
|
},
|
|
|
|
emits: ['change', 'update:modelValue'],
|
|
|
|
watch: {
|
|
value(value) {
|
|
this.$emit('change', value);
|
|
},
|
|
},
|
|
|
|
render() {
|
|
return (
|
|
<div class={bem([this.direction])} role="radiogroup">
|
|
{this.$slots.default?.()}
|
|
</div>
|
|
);
|
|
},
|
|
});
|