Skip to content
On this page

单选框

基础用法

option1
option2
代码示例
js
<template>
    <pied-radio v-model="radio" label="1">option1</pied-radio>
    <pied-radio v-model="radio" label="2">option2</pied-radio>
</template>

<script>
import { ref } from 'vue'
export default{
    setup(){
        const radio = ref('1')
        return {
            radio
        }
    }
}
</script>

禁用

option1
option2
代码示例
js
<template>
    <pied-radio v-model="radio" label="1" disabled>option1</pied-radio>
    <pied-radio v-model="radio" label="2" disabled>option2</pied-radio>
</temlate>

<script>
import { ref } from 'vue'
export default{
    setup(){
        const radio = ref('1')
        return {
            radio
        }
    }
}
</script>

单选框组

option1
option2
代码示例
js
<template>
    <pied-radio-group v-model="radio1" data="data" keys="{label: 'label', value: 'value'}"></pied-radio-group>
</temlate>

<script>
import { ref } from 'vue'
export default{
    setup(){
        const radio = ref('1')
        const data = ref([
            {
                label: 'option1',
                value: 0
            },
            {
                label: 'option2',
                value: 1
            }
        ])
        return {
            radio,
            data
        }
    }
}
</script>
参数说明可选值默认值类型
v-model绑定值----------String,Boolean,Number
disabled禁用false,truefalseBoolean
label单选值----------String,Boolean,Number
key单选组绑定key,value-----{}Object
data单选组数据----------Arrary

Released under the MIT License.