0.1.28 • Published 4 years ago

rat-button v0.1.28

Weekly downloads
8
License
BSD-3-Clause
Repository
github
Last release
4 years ago

rat-button

Button

Build Status tnpm status tnpm download line coverage branch coverage preact

  • category: Components
  • chinese: 按钮
  • type: 表单

按钮用于开始一个即时操作。

Guide

何时使用

标记了一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。

API

Button

参数说明类型默认值
size按钮的尺寸可选值:'small', 'medium', 'large'Enum'medium'
type按钮的类型可选值:'primary', 'secondary', 'normal'Enum'normal'
htmlType当 component = 'button' 时,设置 button 标签的 type 值可选值:'submit', 'reset', 'button'Enum'button'
component设置标签类型可选值:'button', 'a'Enum'button'
loading设置按钮的载入状态Booleanfalse
text是否为文本按钮Booleanfalse
warning是否为警告按钮Booleanfalse
disabled是否禁用Booleanfalse
onClick点击按钮的回调签名:Function(e: Object) => void参数:e: {Object} Event ObjectFunction() => {}

demo

import Button from 'rat-button';

class App extends React.Component {
    // ajax还要tools比较通用,所以从根组件使用context传入,避免props逐层传入
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <Button 
          style={{width: 150, height: 50}}
        >
          submit
        </Button>
      </div>
      )
    }
}
0.1.28

4 years ago

0.1.27

5 years ago

0.1.26

5 years ago

0.1.25

5 years ago

0.1.24

5 years ago

0.1.23

5 years ago

0.1.22

5 years ago

0.1.21

5 years ago

0.1.20

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago