UNPKG

@jdcfe/yep-react

Version:

一套移动端的React组件库

46 lines (39 loc) 1.25 kB
var __rest = this && this.__rest || function (s, e) { var t = {}; for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; } if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import * as React from 'react'; import Wrap from './Wrap'; var InitialComponent = function InitialComponent(props) { return /*#__PURE__*/React.createElement("rect", { x: "0", y: "0", rx: "5", ry: "5", width: props.width, height: props.height }); }; var Skeleton = function Skeleton(props) { var children = props.children, restProps = __rest(props, ["children"]); return /*#__PURE__*/React.createElement(Wrap, restProps, children ? children : /*#__PURE__*/React.createElement(InitialComponent, restProps)); }; Skeleton.defaultProps = { animate: true, speed: 2, width: 400, height: 130, preserveAspectRatio: 'xMidYMid meet', primaryColor: '#f0f0f0', secondaryColor: '#e0e0e0', primaryOpacity: 1, secondaryOpacity: 1 }; export default Skeleton;