# 卡片-图标(Card-Icon)

当设备有较多简单模式选择操作时,推荐使用此控件样式

交互原则

点击icon即可开关对应模式,若有二级更多参数调整,可通过弹窗或页面进行调整后,在对应功能 icon 或名称上有变化,符合可直观查看状态的交互目标

# 示例

<template>
  <div class="wrapper">
    <dof-minibar title="5.4卡片-图标按钮"></dof-minibar>
    <dof-card class="m-b-16">
      <div class="icon-btn-box">
        <dof-icon-button
          v-model="iv2"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
      </div>
    </dof-card>
    <dof-card class="m-b-16">
      <div class="icon-btn-box">
        <dof-icon-button
          v-model="iv2"
          :iconFont="{ code: '\u4794' }"
          text="微信"
          :isHapticFeedback="true"
          :isPlain="true"
          :isShowTriangle="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="微信"
          :isHapticFeedback="true"
          :isPlain="true"
          :isShowTriangle="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="微信"
          :isHapticFeedback="true"
          :isPlain="true"
          :isShowTriangle="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="微信"
          :isHapticFeedback="true"
          :isPlain="true"
          :isShowTriangle="true"
        ></dof-icon-button>
      </div>
    </dof-card>
    <dof-card class="m-b-16">
      <div class="icon-btn-box">
        <dof-icon-button
          v-model="iv2"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
      </div>
      <div class="icon-btn-box m-t-40">
        <dof-icon-button
          v-model="iv2"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
        <dof-icon-button
          v-model="iv1"
          :iconFont="{ code: '\u4794' }"
          text="定时 | 预约"
          :isHapticFeedback="true"
          :isPlain="true"
        ></dof-icon-button>
      </div>
    </dof-card>
  </div>
</template>

<style scoped>
.wrapper {
  background-color: #f9f9f9;
}
.m-b-16 {
  margin-bottom: 16px;
}
.icon-btn-box {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
}
.m-t-40 {
  margin-top: 40px;
}

@media screen and (weex-theme: colmo) {
  .wrapper {
    background-color: #151617;
  }
}
</style>

<script>
import { DofMinibar, DofCard, DofIconButton } from 'dolphin-weex-ui'
export default {
  components: { DofMinibar, DofCard, DofIconButton },
  data: () => ({
    img: 'http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/leaf.png',
    activeImg: 'http://dolphin-weex-dev.msmartlife.cn/static/component/card/image/leaf-t.png',
    iv1: false,
    iv2: true
  }),
  computed: {},
  created() {},
  methods: {}
}
</script>

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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

# Api

# Props

Prop Type Required Default Description
active Boolean N false 是否激活态
img String Y `` 常态图标
activeImg String Y `` 选中态图片
color String N #f2f2f2 常态背景颜色
activeColor String N #267AFF 选中态背景颜色
text String N `` 图标按钮下方文字
textColor String N #000 字体颜色
isFeedbackTouch Boolean N false 是否开启点击未松手更换背景颜色
touchColor String N #d9d9d9 点击未动手背景颜色,isFeedbackTouch为true生效
isLoading Boolean N false 是否是loading状态
loadingImg String N black black/white
isShowTriangle Boolean N false 是否展示图标右下角三角
borderColor String N transparent 常态边框颜色
activeBorderColor String N transparent 选中态背景颜色
isHapticFeedback Boolean N false 是否开启手机震动反馈
btnSize Number N 96 按钮大小
imgSize Number N 96 图片大小
loadingImgSize Number N 32 loading图片大小
disabled Boolean N false 是否禁用
isPlain Boolean N false 朴素按钮(暂时只支持colmo)
iconFont Object false {} 使用iconFont { code: '\uXXX', color: '' }
activeIconFont Object false {} 点击态iconFont { code: '\uXXX', color: '' }

# Events

事件名 说明 回调参数
change 点击时触发 e :Boolean

# Slots

插槽名 说明
default 卡片下方文案
点我扫二维码 查看demo
Last Updated: 1/4/2024, 4:01:09 PM