Button 按钮

使用指南

在 app.json 或 index.json 中引入button组件

{
  "usingComponents": {
    "fs-button": "path/components/button/index"
  }
}
1
2
3
4
5

代码样式

  • 尺寸大小
<fs-button bindtap='handleTap'>按钮</fs-button>
<fs-button size="large">页面主按钮</fs-button>
1
2
  • 朴素样式
<fs-button type="plain" size="large">页面主按钮</fs-button>
1
  • 次要按钮
<fs-button type="secondary" size="large">页面次要按钮</fs-button>
1
  • 禁用
<fs-button disabled size="large">页面主按钮</fs-button>
<fs-button disabled type="plain" size="large">页面主按钮</fs-button>
<fs-button disabled type="secondary" size="large">页面次要按钮</fs-button>
1
2
3
  • 加载中
<fs-button loading size="large">页面主按钮</fs-button>
<fs-button loading type="plain" size="large">页面主按钮</fs-button>
<fs-button loading type="secondary" size="large">页面次要按钮</fs-button>
1
2
3
Page({
  handleTap (e) {
    console.log(e)
  }
})
1
2
3
4
5

属性

参数 说明 类型 默认值
disabled 是否disable Boolen -
loading 是否显示loading图标 Boolen -
size 按钮大小,可选值为 normal large String normal
type 按钮类型,可选值为 primary plain secondary String primary
form-type 微信原生的form-type String -
open-type 微信开放能力 String -
custom-class 自定义的外部样式类 String -

插槽

插槽名 说明
- 默认内容