UNPKG

antd-mobile-taro-ui

Version:

以antd-mobile为设计标准,基于taro框架的微信小程序组件库

28 lines (27 loc) 898 B
import React, { memo } from 'react'; import { withNativeProps } from 'antd-mobile/es/utils/native-props'; import { mergeProps } from 'antd-mobile/es/utils/with-default-props'; import { ProgressCircle } from 'antd-mobile-taro-ui'; import { View } from '@tarojs/components'; const classPrefix = 'adm-spin-loading'; const colorRecord = { default: 'var(--adm-color-weak)', primary: 'var(--adm-color-primary)', white: 'var(--adm-color-white)' }; const defaultProps = { color: 'default' }; export const SpinLoading = memo(p => { var _a; const props = mergeProps(defaultProps, p); return withNativeProps(props, React.createElement(View, { className: classPrefix, style: { '--color': (_a = colorRecord[props.color]) !== null && _a !== void 0 ? _a : props.color } }, React.createElement(ProgressCircle, { percent: 80, className: `${classPrefix}-circle` }))); });