@lx-react-materiel/mp-button

Taro 小程序 button

Usage no npm install needed!

<script type="module">
  import lxReactMaterielMpButton from 'https://cdn.skypack.dev/@lx-react-materiel/mp-button';
</script>

README

mp-button

按钮

该组件只能在 ** Taro3 ** 中使用

代码示例

import MpButton from '@lx-react-materiel/mp-button';

const Demo = () => (
  <MpButton
    type="primary"
    size="large"
    danger
  >按钮示例</MpButton>
);

API

Props

参数 说明 类型 默认值 必填
type 按钮类型 'default' | 'primary' | 'text' | 'normal' 'default'
size 按钮大小 'large' | 'middle' | 'small' 'middle'
shape 按钮形状 'default' | 'round' 'default'
danger 设置危险按钮 boolean false
disabled 按钮禁用状态 boolean false
block 将按钮宽度调整为其父宽度 boolean false
bgColor 背景颜色 string ''
color 文本颜色 string ''
borderColor 边框颜色 string ''
children 按钮内容 React.ReactNode --

Events

事件 说明 回调参数
onClick 点击按钮回调 --