Skip to content

Switch 开关

规则

js
{
    type:"switch",
    title:"是否上架",
    field:"is_show",
    value:"1",
    props: {
        round: false,
    },
}
{
    type:"switch",
    title:"是否上架",
    field:"is_show",
    value:"1",
    props: {
        round: false,
    },
}

参考:naive-ui_Switch

value :Number | String

Props

名称类型默认值说明
checked-valuestring | boolean | numbertrue选中时对应的值
disabledbooleanfalse是否禁用
loadingbooleanfalse是否加载
rail-style(info: { focused: boolean, checked: boolean }) => (CSSProperties | string)undefined创建轨道样式的函数
roundbooleantrue是否为圆形按钮
size'small' | 'medium' | 'large''medium'开关大小
unchecked-valuestring | boolean | numberfalse未选中时对应的值
on-update:value(value: boolean) => voidundefined组件值发生变化的回调

Released under the MIT License.