纷享销客开发者手册 纷享销客开发者手册
  • APL开发手册
  • PWC开发手册
  • OpenAPI 文档
  • 自定义组件(PC端)
  • 自定义组件(小程序)
  • 自定义插件(PC端)
  • 自定义插件(小程序)
  • 第三方集成插件(H5)
  • API(PC端)
  • API(小程序)
  • Fx DevTools
更新日志
  • 简体中文
  • English
  • 自定义组件(PC端)
  • 自定义组件(小程序)
  • 自定义插件(PC端)
  • 自定义插件(小程序)
  • 第三方集成插件(H5)
  • API(PC端)
  • API(小程序)
  • Fx DevTools
更新日志
  • 简体中文
  • English
  • 入门

  • 组件

    • 组件总览

    • 纷享UI组件

    • 微信UI组件

      • 动作面板
      • 按钮
        • 分割线
        • 单选
        • 单选弹窗
        • 多选
        • 确认框
        • 时间选择器/自定义选择器
        • 弹出框
        • 开关
        • 富文本
        • 消息提示
        • 更多基础组件
      • 业务组件

    • 小程序框架

    • 示例

    目录

    按钮

    # fsButton 按钮

    常用的操作按钮。

    # 参数

    参数 说明 类型 可选值 默认值
    size 尺寸 string small / normal / large large
    type 类型 string primary / warn / default default
    plain 是否朴素按钮 boolean — false
    disabled 是否禁用状态 boolean — false
    text 文本 string — —
    btnStyle 按钮样式 string — ''
    textStyle 文本样式 string — ''

    # Slot

    name 说明
    content 按钮内容

    # 基础用法

    基础的按钮用法。

    <view class="test_container">
      <fs-divider tip="默认按钮"></fs-divider>
      <view class="btn-group">
        <fs-button class="fs-btn-cus" text="default"></fs-button>
        <fs-button class="fs-btn-cus" text="primary" type="primary"></fs-button>
        <fs-button class="fs-btn-cus" text="warn" type="warn"></fs-button>
      </view>
      <fs-divider tip="朴素按钮"></fs-divider>
      <view class="btn-group">
        <fs-button class="fs-btn-cus" text="default" plain="{{true}}"></fs-button>
        <fs-button class="fs-btn-cus" text="primary" type="primary" plain="{{true}}"></fs-button>
        <fs-button class="fs-btn-cus" text="warn" type="warn" plain="{{true}}"></fs-button>
      </view>
    </view>
    
    

    # 禁用状态

    按钮不可用状态。

     <view class="test_container">
      <fs-divider tip="禁用按钮"></fs-divider>
      <view class="btn-group">
        <fs-button class="fs-btn-cus" text="default" disabled="{{true}}"></fs-button>
        <fs-button class="fs-btn-cus" text="primary" type="primary" disabled="{{true}}"></fs-button>
        <fs-button class="fs-btn-cus" text="warn" type="warn" disabled="{{true}}"></fs-button>
        <fs-button class="fs-btn-cus" text="default" plain="{{true}}" disabled="{{true}}"></fs-button>
        <fs-button class="fs-btn-cus" text="primary" type="primary" plain="{{true}}" disabled="{{true}}"></fs-button>
        <fs-button class="fs-btn-cus" text="warn" type="warn" plain="{{true}}" disabled="{{true}}"></fs-button>
      </view>
    </view>
    
    

    # 图标按钮

    带图标的按钮可增强辨识度(有文字)或节省空间(无文字)。

    <view class="test_container">
      <fs-divider tip="带自定义图标"></fs-divider>
      <view class="btn-group">
        <fs-button class="fs-btn-cus" text="default">
          <text class="fs-iconfont" slot="left" style="font-size: 20px;">\uE60f</text>
        </fs-button>
      </view>
      <view class="btn-group btn-group-inline">
        <fs-button class="inline_fs-btn-cus" text="primary" type="primary" size="normal">
          <text class="fs-iconfont" slot="left" style="color:#fff;font-size: 20px;">\uE60f</text>
        </fs-button>
        <fs-button class="inline_fs-btn-cus" text="default" type="warn" size="small" plain="{{true}}">
          <text class="fs-iconfont" slot="left" style="color:#FF3F3F;font-size: 20px;">\uE60f</text>
          <text class="fs-iconfont" slot="right" style="color:#FF3F3F;font-size: 20px;">\uE60f</text>
        </fs-button>
        </view>
    </view>
    

    # 不同尺寸

    Button 组件提供除了默认值以外的三种尺寸,可以在不同场景下选择合适的按钮尺寸。

    <view class="test_container">
      <fs-divider tip="正常大小的按钮"></fs-divider>
      <view class="btn-group btn-group-inline">
        <fs-button class="inline_fs-btn-cus" text="default" size="normal"></fs-button>
        <fs-button class="inline_fs-btn-cus" text="primary" type="primary" size="normal"></fs-button>
        <fs-button class="inline_fs-btn-cus" text="warn" type="warn" size="normal"></fs-button>
      </view>
      <view class="btn-group btn-group-inline">
        <fs-button class="inline_fs-btn-cus" text="default" plain="{{true}}" size="normal"></fs-button>
        <fs-button class="inline_fs-btn-cus" text="primary" type="primary" plain="{{true}}" size="normal"></fs-button>
        <fs-button class="inline_fs-btn-cus" text="warn" type="warn" plain="{{true}}" size="normal"></fs-button>
      </view>
      <fs-divider tip="最小的按钮"></fs-divider>
      <view class="btn-group btn-group-inline">
        <fs-button class="inline_fs-btn-cus" text="default" size="small"></fs-button>
        <fs-button class="inline_fs-btn-cus" text="primary" type="primary" size="small"></fs-button>
        <fs-button class="inline_fs-btn-cus" text="warn" type="warn" size="small"></fs-button>
      </view>
      <view class="btn-group btn-group-inline">
        <fs-button class="inline_fs-btn-cus" text="default" plain="{{true}}" size="small"></fs-button>
        <fs-button class="inline_fs-btn-cus" text="primary" type="primary" plain="{{true}}" size="small"></fs-button>
        <fs-button class="inline_fs-btn-cus" text="warn" type="warn" plain="{{true}}" size="small"></fs-button>
      </view>
    </view>
    </fx-row>
    
    动作面板
    分割线

    ← 动作面板 分割线→

    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式