Skip to content

Radio 单选框 ​

从同一组选项中选择一项

交互示例 ​

查看用法代码
vue
<script setup lang="ts">
import { ZRadio } from '@codex-proxy/ui'
import { ref } from 'vue'

const scope = ref('selected')
</script>

<template>
  <ZRadio v-model="scope" name="scope" value="selected" label="指定请求" />
  <ZRadio v-model="scope" name="scope" value="all" label="全部请求" />
</template>

使用要点 ​

同组使用相同的 name 与 v-model,每个选项设置不同的 value

API ​

属性 ​

属性类型默认值说明
v-modelstring必填当前选中值
disabledbooleanfalse禁用此选项

| value | string \| number | 必填 | 选项值 | | name / label | string | — | 分组名和可见标签;隐藏名称使用 aria-label |

事件 ​

事件说明
update:modelValuestring,绑定值变化

插槽 ​

插槽说明