1.0.2 • Published 5 years ago

react-random-font-size v1.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

react-random-font-sizeVersion

Version

文本中的随机字符串放大的组件,适用于React

预览/Preview


demo

快速开始/How To Start


npm install react-random-font-size --save-dev

or

yarn add react-random-font-size --save-dev

test.js

import React, {Component} from 'react'
import ReactRandomFontSize from 'react-random-font-size'

class Test extends Component {
  constructor() {
    super();
    this.state = {
      font: '组件需要传入参数!',
      style: {
       "font-size": "20px"
      }  
    };
  }

  render() {
    return (
      <ReactRandomFontSize
        data={this.state.font}
        fontStyle={this.state.style}
      />
    );
  }
}

export default Text

接口/Interface


属性/Props

属性名/Name描述/Description类型/Type默认值/Default Value
data节点树的数据String组件需要传入参数!
fontStyle被放大字体的样式(将会被插入到其元素的style属性中)Object{"font-size": "20px"}
proportion随机放大的字符数量占字符总数的比例Number0.3
enlarge不随机放大字符;指定放大某些字符;String--

许可证/License


MIT