import React, { useState } from 'react'; import { ComponentStory, ComponentMeta } from '@storybook/react'; import { OPSwitch } from '../../src/index'; export default { title: '组件/通用/OPSwitch', component: OPSwitch, } as ComponentMeta; export const 受控开关: ComponentStory = (): JSX.Element => { const [v1, setV1] = useState(false); const [v2, setV2] = useState(false); const [v3, setV3] = useState(false); return (

简单-{v1.toString()}

{ setV1(v); }} />

带文案-{v2.toString()}

{ setV2(v); }} />

快捷键-{v3.toString()}

{ setV3(v); }} />

悬浮提示

{ setV3(v); }} balloon={{ children: '功能介绍', }} />

只读

); };