ant-design-vue/components/radio/demo/radioGroup-more.vue

38 lines
828 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<docs>
---
order: 4
title:
zh-CN: RadioGroup 垂直
en-US: Vertical RadioGroup
---
## zh-CN
垂直的 RadioGroup配合更多输入框选项
## en-US
Vertical RadioGroup, with more radios.
</docs>
<template>
<a-radio-group v-model:value="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: 100px; margin-left: 10px" />
</a-radio>
</a-radio-group>
</template>
<script lang="ts" setup>
import { reactive, ref } from 'vue';
const value = ref<number>(1);
const radioStyle = reactive({
display: 'flex',
height: '30px',
lineHeight: '30px',
});
</script>