1.0.7 • Published 4 years ago

number-rock-react v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

About number-rock-react

A component that lets numbers animated, for react

Install

npm install number-rock-react --save

Usage

import NumberRock from 'number-rock-react';
<NumberRock 
  start={888} 
  end={1234} 
  precision={2} 
  duration={2000}
  >
</NumberRock>

Props

property 参数description 描述require 是否必须type 类型fn accept property 函数接收的参数
startstart number 开始值TRUEnumber
endend number 结束值TRUEnumber
precisionprecision number精度FALSEnumber
durationduration time 持续时间FALSEnumber
formatefunction, must return a val 格式化方法 ,接收一个参数,必须返回一个处理后的值FALSEfunctionnumber
onProgresscallback in progress 翻滚进行中触发的方法FALSEfunctionframeVal, progress
onEndcallback at the end 翻滚结束后的回调FALSEfunctionend
classNamename of the component class 类名FALSEstring
processingClassNamename of the processing class 翻滚进行中的类名FALSEstring
stylestyle 样式FALSEobject
processingStylestyle in progress 翻滚进行中的样式FALSEobject

Example

import React,{ Component } from 'react';
import ReactDOM from 'react-dom';
import NumberRock from 'number-rock-react';

const formate = v => '$' + v;

class App extends Component {
  render() {
    return (
      <NumberRock 
        start={888} 
        end={1234} 
        precision={2} 
        duration={2000}
        formate={formate}
        >
      </NumberRock>
    );
  }
}

ReactDOM.render(<App/>,document.getElementById('root'))
1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago