{ "slug": "switchgroup", "mode": "single", "examples": [ { "id": "switchgroup-ex-1", "title": "基础用法", "titleSrc": "", "desc": "", "html": "
\n
\n
", "preview": { "show": [ [ 0 ] ], "hide": [], "mode": "single" }, "previewSafe": true, "previewUnsafeReasons": [], "source": "curated", "code": { "html": "
", "jsx": "import { useState } from 'react';\nimport { KoleSwitchGroup } from 'kole-ui/react';\n\nconst options = [\n { label: '邮件通知', value: 'mail', desc: '接收系统邮件提醒' },\n { label: '短信通知', value: 'sms', desc: '重要变更发送短信' },\n { label: '站内信', value: 'inbox', desc: '工作台消息中心' }\n];\n\nexport default function NotifySettingGroup() {\n const [value, setValue] = useState(['mail', 'inbox']);\n return (\n \n );\n}", "vue3": "\n\n", "vue2": "\n\n", "tsx": "import { useState } from 'react';\nimport { KoleSwitchGroup } from 'kole-ui/react';\n\nconst options = [\n { label: '邮件通知', value: 'mail', desc: '接收系统邮件提醒' },\n { label: '短信通知', value: 'sms', desc: '重要变更发送短信' },\n { label: '站内信', value: 'inbox', desc: '工作台消息中心' }\n];\n\nexport default function NotifySettingGroup(): JSX.Element {\n const [value, setValue] = useState(['mail', 'inbox']);\n return (\n \n );\n}", "vue3ts": "\n\n", "vue2ts": "\n\n" }, "notes": "依据 frameworks/SwitchGroup.html:17-21 DATA 三项实参(邮件/短信/站内信)、:26 标题「通知设置」、:27 全选开关、:41-47 单项切换" } ], "curated": true }