Skip to content
On this page

多选框

基础用法

option1
代码示例
js
<template>
    <pied-checkbox v-model="checkbox">option1</pied-checkbox>
</template>

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

禁用

option1
option2
代码示例
js
<template>
    <pied-checkbox v-model="checkbox1">option1</pied-checkbox>
    <pied-checkbox v-model="checkbox" disabled>option2</pied-checkbox>
</template>

<script>
import { ref } from 'vue'
export default{
    setup(){
        const checkbox = ref(false)
        const checkbox1 = ref(true)
        return {
            checkbox,
            checkbox1
        }
    }
}
</script>

选中边框

option1
option2
代码示例
js
<template>
    <pied-checkbox v-model="checkbox1" border>option1</pied-checkbox>
    <pied-checkbox v-model="checkbox" border>option2</pied-checkbox>
</template>

<script>
import { ref } from 'vue'
export default{
    setup(){
        const checkbox = ref(false)
        const checkbox1 = ref(true)
        return {
            checkbox,
            checkbox1
        }
    }
}
</script>

多选框组

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

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

Released under the MIT License.