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

  • 组件

    • 组件总览
    • UI组件

      • 按钮
        • 单选框
        • 多选框
        • 输入框
        • 计数器
        • 选择器
        • 级联选择器
        • 开关
        • 时间选择器
        • 日期选择器
        • 日期时间选择器
        • 上传
        • 颜色选择器
        • 表格
        • 标签
        • 进度条
        • 树形控件
        • 分页
        • 标记
        • 警告
        • 消息提示
        • 弹框
        • 通知
        • 下拉菜单
        • 步骤条
        • 对话框
        • 卡片
        • 日历
        • 文字提示
        • 弹出框
        • 折叠面板
        • 走马灯
      • 业务组件

    • 示例

    • 常见问题

    目录

    按钮

    # FxButton 按钮

    常用的操作按钮。

    # 参数

    参数 说明 类型 可选值 默认值 PC/移动端支持情况
    size 尺寸 string medium / small / mini — 仅PC
    type 类型 string primary / success / warning / danger / info / text — 移动端仅支持primary/ success/ default/ danger
    plain 是否朴素按钮 boolean — false PC/移动端
    round 是否圆角按钮 boolean — false 仅PC
    circle 是否圆形按钮 boolean — false 仅PC
    loading 是否加载中状态 boolean — false PC/移动端
    disabled 是否禁用状态 boolean — false PC/移动端
    icon 图标类名 string — — 仅PC
    autofocus 是否默认聚焦 boolean — false 仅PC
    native-type 原生 type 属性 string button / submit / reset button 仅PC

    # Slot

    仅移动端

    name 说明
    content 按钮内容

    # 基础用法

    基础的按钮用法。

    默认按钮 主要按钮 成功按钮 信息按钮 警告按钮 危险按钮 朴素按钮 主要按钮 成功按钮 信息按钮 警告按钮 危险按钮 圆角按钮 主要按钮 成功按钮 信息按钮 警告按钮 危险按钮

    使用type、plain、round和circle属性来定义 Button 的样式。

      <fx-row>
        <fx-button>默认按钮</fx-button>
        <fx-button type="primary">主要按钮 <i class="el-icon-arrow-down"></i></fx-button>
        <fx-button type="success">成功按钮</fx-button>
        <fx-button type="info">信息按钮</fx-button>
        <fx-button type="warning">警告按钮</fx-button>
        <fx-button type="danger">危险按钮</fx-button>
      </fx-row>
    
      <fx-row>
        <fx-button plain>朴素按钮</fx-button>
        <fx-button type="primary" plain>主要按钮</fx-button>
        <fx-button type="success" plain>成功按钮</fx-button>
        <fx-button type="info" plain>信息按钮</fx-button>
        <fx-button type="warning" plain>警告按钮</fx-button>
        <fx-button type="danger" plain>危险按钮</fx-button>
      </fx-row>
    
      <fx-row>
        <fx-button round>圆角按钮</fx-button>
        <fx-button type="primary" round>主要按钮</fx-button>
        <fx-button type="success" round>成功按钮</fx-button>
        <fx-button type="info" round>信息按钮</fx-button>
        <fx-button type="warning" round>警告按钮</fx-button>
        <fx-button type="danger" round>危险按钮</fx-button>
      </fx-row>
    
      <fx-row>
        <fx-button icon="el-icon-search" circle></fx-button>
        <fx-button type="primary" icon="el-icon-edit" circle></fx-button>
        <fx-button type="success" icon="el-icon-check" circle></fx-button>
        <fx-button type="info" icon="el-icon-message" circle></fx-button>
        <fx-button type="warning" icon="el-icon-star-off" circle></fx-button>
        <fx-button type="danger" icon="el-icon-delete" circle></fx-button>
      </fx-row>
    
    
    显示代码 复制代码 复制代码

    # 禁用状态

    按钮不可用状态。

    默认按钮 主要按钮 成功按钮 信息按钮 警告按钮 危险按钮 朴素按钮 主要按钮 成功按钮 信息按钮 警告按钮 危险按钮

    您可以使用disabled属性来定义按钮是否可用,它接受一个Boolean值。

    <fx-row>
      <fx-button disabled>默认按钮</fx-button>
      <fx-button type="primary" disabled>主要按钮</fx-button>
      <fx-button type="success" disabled>成功按钮</fx-button>
      <fx-button type="info" disabled>信息按钮</fx-button>
      <fx-button type="warning" disabled>警告按钮</fx-button>
      <fx-button type="danger" disabled>危险按钮</fx-button>
    </fx-row>
    
    <fx-row>
      <fx-button plain disabled>朴素按钮</fx-button>
      <fx-button type="primary" plain disabled>主要按钮</fx-button>
      <fx-button type="success" plain disabled>成功按钮</fx-button>
      <fx-button type="info" plain disabled>信息按钮</fx-button>
      <fx-button type="warning" plain disabled>警告按钮</fx-button>
      <fx-button type="danger" plain disabled>危险按钮</fx-button>
    </fx-row>
    
    显示代码 复制代码 复制代码

    # 文字按钮

    没有边框和背景色的按钮。

    文字按钮 文字按钮
    <fx-button type="text">文字按钮</fx-button>
    <fx-button type="text" disabled>文字按钮</fx-button>
    
    显示代码 复制代码 复制代码

    # 图标按钮

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

    搜索 上传

    设置icon属性即可,icon 的列表可以参考 Element 的 icon 组件,也可以设置在文字右边的 icon ,只要使用i标签即可,可以使用自定义图标。

    <fx-button type="primary" icon="el-icon-edit"></fx-button>
    <fx-button type="primary" icon="el-icon-share"></fx-button>
    <fx-button type="primary" icon="el-icon-delete"></fx-button>
    <fx-button type="primary" icon="el-icon-search">搜索</fx-button>
    <fx-button type="primary">上传<i class="el-icon-upload el-icon--right"></i></fx-button>
    
    显示代码 复制代码 复制代码

    # 按钮组

    以按钮组的方式出现,常用于多项类似操作。

    上一页 下一页

    使用<fx-button-group>标签来嵌套您的按钮。

    <fx-button-group>
      <fx-button type="primary" icon="el-icon-arrow-left">上一页</fx-button>
      <fx-button type="primary">下一页<i class="el-icon-arrow-right el-icon--right"></i></fx-button>
    </fx-button-group>
    <fx-button-group>
      <fx-button type="primary" icon="el-icon-edit"></fx-button>
      <fx-button type="primary" icon="el-icon-share"></fx-button>
      <fx-button type="primary" icon="el-icon-delete"></fx-button>
    </fx-button-group>
    
    显示代码 复制代码 复制代码

    # 加载中

    点击按钮后进行数据加载操作,在按钮上显示加载状态。

    加载中

    要设置为 loading 状态,只要设置loading属性为true即可。

    <fx-button type="primary" :loading="true">加载中</fx-button>
    
    显示代码 复制代码 复制代码

    # 不同尺寸

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

    默认按钮 中等按钮 小型按钮 超小按钮 超超小按钮 默认按钮 中等按钮 小型按钮 超小按钮 超超小按钮

    额外的尺寸:medium、small、mini,通过设置size属性来配置它们。

    <fx-row>
      <fx-button>默认按钮</fx-button>
      <fx-button size="medium">中等按钮</fx-button>
      <fx-button size="small">小型按钮</fx-button>
      <fx-button size="mini">超小按钮</fx-button>
      <fx-button size="micro">超超小按钮</fx-button>
    </fx-row>
    <fx-row>
      <fx-button round>默认按钮</fx-button>
      <fx-button size="medium" round>中等按钮</fx-button>
      <fx-button size="small" round>小型按钮</fx-button>
      <fx-button size="mini" round>超小按钮</fx-button>
      <fx-button size="micro" round>超超小按钮</fx-button>
    </fx-row>
    
    显示代码 复制代码 复制代码
    组件总览
    单选框

    ← 组件总览 单选框→

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