Button

按钮组件。

Install

  1. npm install beeshell

Usage

引入方式

全部引入

  1. import { Button } from 'beeshell';

单独引入

  1. import Button from 'beeshell/components/Button';

Examples

image

Code

  1. import React from 'react';
  2. import { Button } from 'beeshell';
  3. class App extends React.Component {
  4. render() {
  5. return (
  6. <View>
  7. <Button type="primary" size="md" responsive={false}>首选项 primary</Button>
  8. <Button type="primary" size="md" responsive={false}>
  9. <View>
  10. <Text>自定义</Text>
  11. <Text>支持组件</Text>
  12. </View>
  13. </Button>
  14. </View>
  15. );
  16. }
  17. }

Props

Name Type Required Default Description
type String true null 指明按钮的预定义样式,default primary success info warning danger disabled
size String false ‘md’ 尺寸,lg md sm
responsive Boolean false false 是否拉伸至父组件 100% 宽度
onPress Function false null 点击回调