# local-loading LLMs.txt > 供 LLM 快速理解 `@flatbiz/antd/local-loading` 的使用方式。 ## 模块定位 局部加载,包含接口数据处理逻辑 ## 导入方式 ```ts import { LocalLoading } from '@flatbiz/antd/local-loading'; // 也可以从主入口导入:import { ... } from '@flatbiz/antd'; ``` ## 公开导出 - `LocalLoading` - 局部加载,包含接口数据处理逻辑 - `LocalLoadingInner` - 局部加载,包含接口数据处理逻辑 - `LocalLoadingServiceConfig` - `LocalLoadingProps` - `LocalLoadingRefApi` ## 依赖的 antd 能力 `Button`、`Result`、`Spin` ## Props / 配置要点 ### LocalLoadingServiceConfig - `onRequest`(可选):: (params?: TAny) => Promise - `params`(可选):: TPlainObject - `invalidParamKey`(可选):: string[];标记serviceConfig.params中无效参数,被设置的params key 不传入服务接口入参 - `requiredParamsKeys`(可选):: string[];必填字段设置 ### LocalLoadingProps - `className`(可选):: string - `style`(可选):: CSSProperties - `contentStyle`(可选):: CSSProperties - `serviceConfig`(必填):: LocalLoadingServiceConfig;接口数据配置 - `children`(可选):: (respData?: TAny) => ReactElement;children 为函数,参数【respData】为接口返回数据 - `isAsync`(可选):: boolean;是否异步,默认:false - `loadingHeight`(可选):: number | string;loading高度,默认值:100;isAsync = true 无效 - `loadingSpinProps`(可选):: { tip?: string; content?: ReactElement; bgColor?: string; };loading spin 属性设置 - `textConfigs`(可选):: { requiredErrorText?: string; };必填异常文本 - `showRequiredError`(可选):: boolean;是否显示必填异常 - `errorRender`(可选):: (error?: TAny) => ReactElement;自定义异常渲染处理 - `contentScroll`(可选):: boolean;设置内部滚动,需要设置 style.height 才能生效,@5.0.16 - `height`(可选):: number | string;设置高度 ## 使用规则与行为 - 局部加载,包含接口数据处理逻辑 - 标记serviceConfig.params中无效参数,被设置的params key 不传入服务接口入参 - 必填字段设置 - 接口数据配置 - children 为函数,参数【respData】为接口返回数据 - 是否异步,默认:false - loading高度,默认值:100;isAsync = true 无效 - loading spin 属性设置 - loading tip,默认值:Loading - loading 内容 ## 默认值线索 - `loadingHeight => 100` ## 基础示例 ```tsx import { LocalLoading, type LocalLoadingProps } from '@flatbiz/antd/local-loading'; const props: LocalLoadingProps = { // 按业务传入必要参数 }; ; ``` ## 源码索引 - `src/local-loading/context.ts` - `src/local-loading/index.ts` - `src/local-loading/local-loading.tsx` ## 给 LLM 的注意事项 - 优先使用 `@flatbiz/antd/local-loading` 或主入口 `@flatbiz/antd` 的公开导出,不要引用内部实现文件。 - 当 Props 与 antd 原组件同名能力冲突时,以本模块导出的 Props 类型为准。 - 若文档未覆盖某个边缘参数,请读取上方源码索引中的类型定义和 JSDoc。