You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ant-design-vue/components/radio/demo/radioGroup-more.md

43 lines
904 B

7 years ago
<cn>
#### RadioGroup 垂直
垂直的 RadioGroup配合更多输入框选项。
</cn>
<us>
#### Vertical RadioGroup
Vertical RadioGroup, with more radios.
</us>
```html
<template>
<a-radio-group @change="onChange" v-model="value">
<a-radio :style="radioStyle" :value="1">Option A</a-radio>
<a-radio :style="radioStyle" :value="2">Option B</a-radio>
<a-radio :style="radioStyle" :value="3">Option C</a-radio>
<a-radio :style="radioStyle" :value="4">
More...
<a-input v-if="value === 4" :style="{ width: 100, marginLeft: 10 }" />
</a-radio>
</a-radio-group>
</template>
<script>
export default {
data () {
return {
value: 1,
radioStyle: {
display: 'block',
height: '30px',
lineHeight: '30px',
},
}
},
methods: {
onChange (e) {
console.log('radio checked', e.target.value)
},
},
}
</script>
```