diff --git a/.changeset/angry-teachers-dream.md b/.changeset/angry-teachers-dream.md new file mode 100644 index 000000000..80c65cb17 --- /dev/null +++ b/.changeset/angry-teachers-dream.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/loading": minor +--- + +feat: add wrapperClassName and wrapperStyle apis diff --git a/.changeset/plenty-pillows-arrive.md b/.changeset/plenty-pillows-arrive.md new file mode 100644 index 000000000..69d95bf42 --- /dev/null +++ b/.changeset/plenty-pillows-arrive.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +feat(loading): add wrapperClassName and wrapperStyle apis diff --git a/packages/ui/loading/src/Loading.tsx b/packages/ui/loading/src/Loading.tsx index fb70ab6de..bb80c766d 100644 --- a/packages/ui/loading/src/Loading.tsx +++ b/packages/ui/loading/src/Loading.tsx @@ -30,6 +30,8 @@ export const Loading = forwardRef( timeout = 300, indicator, type = 'dot', + wrapperClassName, + wrapperStyle, ...restProps }, ref @@ -88,7 +90,7 @@ export const Loading = forwardRef( {children ? ( // 可以测量 children margin,实现按内容位置偏移,排除 margin 影响 // 暂时不考虑,如果有需要,完全可以把 margin 设置到加到父节点 -
+
{children} {loadingComponent}
@@ -157,6 +159,14 @@ export interface LoadingProps extends HiBaseHTMLProps<'div'> { * loading 效果类型 */ type?: 'dot' | 'spin' + /** + * 设置包裹器类名 + */ + wrapperClassName?: string + /** + * 设置包裹器样式 + */ + wrapperStyle?: React.CSSProperties } if (__DEV__) {