§ Button 按钮

§ fox-button 按钮组件

§ HTML

§ 有底色按钮

<!-- 默认时的按钮字体颜色为白色 -->
<fox-button>默认</fox-button> 
<fox-button class="fox-btn-primary">蓝色</fox-button>
<fox-button class="fox-btn-success">绿色</fox-button>
<fox-button class="fox-btn-warning">黄色</fox-button>
<fox-button class="fox-btn-danger">红色</fox-button>
<fox-button class="fox-btn-royal">紫色</fox-button>
1
2
3
4
5
6
7

§ 无底色按钮(使用父元素的背景色)

<!-- 默认时的按钮字体颜色为白色 -->
<fox-button class="fox-btn-outlined">
    默认
</fox-button>
<fox-button class="fox-btn-primary fox-btn-outlined">
    操作
</fox-button>
<fox-button class="fox-btn-success fox-btn-outlined">
    成功
</fox-button>
<fox-button class="fox-btn-warning fox-btn-outlined">
    警告
</fox-button>
<fox-button class="fox-btn-danger fox-btn-outlined">
    危险
 </fox-button>
 <fox-button class="fox-btn-royal fox-btn-outlined">
     高贵
 </fox-button>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

§ 链接按钮

<fox-button class="fox-btn-link">添加</fox-button>
1

§ API

§ Props

组件支持以下属性

参数 说明 类型 默认值
disabled 是否可用 Boolean false

§ Event

支持以下事件:

事件 说明
tap 点击事件

§ Slots

支持以下插槽:

名称 说明
default 标签名

§ fox-button-row 按钮行

§ HTML

<fox-button-row align="left">
    <fox-button class="fox-btn-primary">蓝色</fox-button>
    <fox-button class="fox-btn-success">绿色</fox-button>
</fox-button-row>
1
2
3
4

§ API

§ Props

组件支持以下属性

参数 说明 类型 默认值
align 按钮水平位置 String center

§ fox-btn-group 按钮组

<template>
  <fox-page>
    <fox-content>
      <fox-btn-group :items="item" iconAlign="right" @select="selectBtnSelect" v-model="sel_val" valueType="item">
      </fox-btn-group>
    </fox-content>
  </fox-page>
</template>
<script>
export default {
  // 数据
  data () {
    return {
      sel_val: '',
      item: [{
        index: 0,
        icon: 'iconfont icon-cuowu',
        value: 'btn1',
        text: '按钮1',
      },
      {
        index: 1,
        icon: 'iconfont icon-plus',
        value: 'bth2',
        text: '按钮2',
      },
      ],
    }
  },
  // 方法
  methods: {
    selectBtnSelect () {
      console.info(this.sel_val)
    },
  },
}
</script>
<style scoped>
</style>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

§ API

§ Props

组件支持以下属性

参数 说明 类型 默认值
value/v-model 选中按钮绑定的值 String/Object
disabled 是否可用 Boolean false
items 按钮组数据(必传) Array
iconAlign 字体图标的水平位置 String(left/right) left
valueType 返回值类型 String(text / value / item) value

§ Event

支持以下事件:

事件 说明
select 选择事件
最后更新于: 7/4/2022, 3:11:25 PM