UNPKG

qt-public-ui

Version:

新设计规范下业务组件库

36 lines 1.44 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; var _excluded = ["type", "indicator", "tip", "spinning", "children", "style"]; import React from 'react'; import { Spin } from 'antd'; var Loading = function Loading(props) { var type = props.type, indicator = props.indicator, _props$tip = props.tip, tip = _props$tip === void 0 ? '正在加载中' : _props$tip, spinning = props.spinning, children = props.children, style = props.style, spinProps = _objectWithoutPropertiesLoose(props, _excluded); if (type === 'page') { return /*#__PURE__*/React.createElement("div", { className: "umui-loading", style: style }, children, spinning && /*#__PURE__*/React.createElement("div", { className: "umui-loading-content" }, /*#__PURE__*/React.createElement("div", null, indicator || /*#__PURE__*/React.createElement("img", { className: "umui-loading-img", src: "//img.alicdn.com/tfs/TB11L6VOFY7gK0jSZKzXXaikpXa-240-240.gif" }), tip && /*#__PURE__*/React.createElement("div", { className: "umui-loading-tip" }, tip)))); } return /*#__PURE__*/React.createElement(Spin, _extends({ spinning: spinning, indicator: indicator, tip: tip, style: style }, spinProps), children); }; Loading.displayName = 'Loading'; export default Loading;