# switch-confirm-wrapper LLMs.txt > 供 LLM 快速理解 `@flatbiz/antd/switch-confirm-wrapper` 的使用方式。 ## 模块定位 @description switch 切换时做二次pop提醒, 非可控组件【内部控制】 close:switch 由开启转换成关闭时pop弹出 open:switch 由开启转换成开启时pop弹出 all:switch 一直pop none:switch 不弹出 @field onRequest 请求函数 @field message message配置 success defaultError ## 导入方式 ```ts import { SwitchConfirmWrapper } from '@flatbiz/antd/switch-confirm-wrapper'; // 也可以从主入口导入:import { ... } from '@flatbiz/antd'; ``` ## 公开导出 - `* from ./switch-confirm-wrapper.jsx` - `SwitchConfirmWrapper` - @description switch 切换时做二次pop提醒, 非可控组件【内部控制】 close:switch 由开启转换成关闭时pop弹出 open:switch 由开启转换成开启时pop弹出 all:switch 一直pop none:switch 不弹出 @field… - `SwitchConfirmWrapperValue` - `SwitchConfirmWrapperProps` ## 依赖的 antd 能力 `message`、`Popconfirm`、`PopconfirmProps`、`Switch`、`SwitchProps` ## Props / 配置要点 ### SwitchConfirmWrapperProps - `value`(可选):: SwitchConfirmWrapperValue - `checkedValue`(必填):: SwitchConfirmWrapperValue - `unCheckedValue`(必填):: SwitchConfirmWrapperValue - `needConfirm`(可选):: 'close' | 'open' | 'all' | 'none' - `noMessage`(可选):: boolean - `onChange`(可选):: (value: SwitchConfirmWrapperValue) => void - `popConfirmProps`(可选):: | Pick | (( checked?: boolean ) => Pick) - `serviceConfig`(可选):: { onRequest: (value: SwitchConfirmWrapperValue) => TAny; message?: { success?: string; defaultError?: string; }; } ## 基础示例 ```tsx import { SwitchConfirmWrapper, type SwitchConfirmWrapperProps } from '@flatbiz/antd/switch-confirm-wrapper'; const props: SwitchConfirmWrapperProps = { // 按业务传入必要参数 }; ; ``` ## 源码索引 - `src/switch-confirm-wrapper/index.ts` - `src/switch-confirm-wrapper/switch-confirm-wrapper.tsx` ## 给 LLM 的注意事项 - 优先使用 `@flatbiz/antd/switch-confirm-wrapper` 或主入口 `@flatbiz/antd` 的公开导出,不要引用内部实现文件。 - 当 Props 与 antd 原组件同名能力冲突时,以本模块导出的 Props 类型为准。 - 若文档未覆盖某个边缘参数,请读取上方源码索引中的类型定义和 JSDoc。