7c-react-loader 中文文档教程

发布于 7年前 浏览 29 项目主页 更新于 3年前

7c-react-loader

ReactJS 的简单“加载器”库。 制作漂亮的动画加载器。

Installation

通过 npm/yarn 使用 7c-react-loader

npm install 7c-react-loader --save

yarn add 7c-react-loader

Basic usage

import Loader from '7c-react-loader';

<Loader active={true}>
    <div>Lorem ipsum</div>
</Loader>

Properties

Prop nameIs requiredType of valueDescriptionDefault value
activeYESbooleanLoader should be shown. For 'true' CSS classes defined in className prop will be added toelement-
childrenNOelementContent to render-
activeClassNameNOAny type accepted by classNamesCSS classes that will be added toelement when it is active"7c-react-loader-active"
delayNOintegerDelayed defined in milliseconds after with CSS classes will be applied toelement0
disabledClassNameNOAny type accepted by classNamesCSS classes that will be added toelement when it isn't active (is disabled)"7c-react-loader-disabled"
tagNOstring or functionTag ofcomponentdiv

Usage

CSS 类(默认:“7c-react-loader-active”)安装将立即应用于元素。 不管怎样都会渲染子道具。

<Loader active={true}>
    ...
</Loader>

CSS 类将在 500 毫秒后应用于

<Loader active={true} delay={500}>
   ...

CSS 类“loader-active”将在 500 毫秒后应用于。 否则将应用“loader-disabled”CSS 类。元素将呈现为“span”。

<Loader active={true} activeClassName="loader-active" disabledClassName="loader-disabled" tag="span" delay={500}>
   ...

Dependencies

7c-react-loader 要求:

License

MIT License

Copyright (c) 2018 Michał Parulski http://opensource.org/licenses/MIT

7c-react-loader

Simple “loader” library for ReactJS. Makes beautiful, animated loader.

Installation

Install by npm/yarn with 7c-react-loader

npm install 7c-react-loader --save

or

yarn add 7c-react-loader

Basic usage

import Loader from '7c-react-loader';

<Loader active={true}>
    <div>Lorem ipsum</div>
</Loader>

Properties

Prop nameIs requiredType of valueDescriptionDefault value
activeYESbooleanLoader should be shown. For 'true' CSS classes defined in className prop will be added toelement-
childrenNOelementContent to render-
activeClassNameNOAny type accepted by classNamesCSS classes that will be added toelement when it is active"7c-react-loader-active"
delayNOintegerDelayed defined in milliseconds after with CSS classes will be applied toelement0
disabledClassNameNOAny type accepted by classNamesCSS classes that will be added toelement when it isn't active (is disabled)"7c-react-loader-disabled"
tagNOstring or functionTag ofcomponentdiv

Usage

CSS classes (default: "7c-react-loader-active") will be applied toelement immediately. Children props will be rendered regardless of that.

<Loader active={true}>
    ...
</Loader>

CSS classes will be applied toafter 500 milliseconds.

<Loader active={true} delay={500}>
   ...

CSS class "loader-active" will be applied toafter 500 milliseconds. Otherwise will be applied "loader-disabled" CSS class.element will be rendered as "span".

<Loader active={true} activeClassName="loader-active" disabledClassName="loader-disabled" tag="span" delay={500}>
   ...

Dependencies

7c-react-loader requires:

License

MIT License

Copyright (c) 2018 Michał Parulski http://opensource.org/licenses/MIT

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文