element-plus/docs/examples/radio/button-style.vue
kooriookami 3ca4473aeb
feat(components): [checkbox & radio] Use value instead of label act as value (#15525)
* feat(components): [checkbox & radio] Use value instead of label

* feat(components): update

* feat(components): update

* feat(components): update

* feat(components): update

* feat(components): update

* feat(components): update test

* feat(components): true-value false-value

* feat(components): update
2024-02-28 12:48:07 +08:00

35 lines
1.2 KiB
Vue

<template>
<div>
<el-radio-group v-model="radio1" size="large">
<el-radio-button label="New York" value="New York" />
<el-radio-button label="Washington" value="Washington" />
<el-radio-button label="Los Angeles" value="Los Angeles" />
<el-radio-button label="Chicago" value="Chicago" />
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-radio-group v-model="radio2">
<el-radio-button label="New York" value="New York" />
<el-radio-button label="Washington" value="Washington" />
<el-radio-button label="Los Angeles" value="Los Angeles" />
<el-radio-button label="Chicago" value="Chicago" />
</el-radio-group>
</div>
<div style="margin-top: 20px">
<el-radio-group v-model="radio3" size="small">
<el-radio-button label="New York" value="New York" />
<el-radio-button label="Washington" value="Washington" disabled />
<el-radio-button label="Los Angeles" value="Los Angeles" />
<el-radio-button label="Chicago" value="Chicago" />
</el-radio-group>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const radio1 = ref('New York')
const radio2 = ref('New York')
const radio3 = ref('New York')
</script>