tm-icons 图标
🎉目录导航
👉使用方法,跟数1,2,3一样简单
基本示例
<tm-icons :size="48" name="icon-filter-fill"></tm-icons>
1
图片图标
<tm-icons :size="100" name="https://cdn.roundicons.com/wp-content/uploads/2017/09/Lego-freebie-icon.png"></tm-icons>
1
👉完整的示例
可以复制到页面直接运行
<template>
<view>
<tm-menubars title="图标" color="bg-gradient-blue-accent" :showback="true"></tm-menubars>
<tm-sheet>
<view class="text-size-s text-weight-b mb-24">基本示例</view>
<tm-icons :size="48" name="icon-filter-fill"></tm-icons>
<tm-icons color="red" :size="48" name="icon-paperplane-fill"></tm-icons>
<tm-icons color="blue" :size="48" name="icon-position-fill"></tm-icons>
<tm-icons color="pink" :size="48" name="icon-layergroup-fill"></tm-icons>
<tm-icons color="green" :size="48" name="icon-unlock-fill"></tm-icons>
</tm-sheet>
<tm-sheet>
<view class="text-size-s text-weight-b mb-24">图片图标</view>
<tm-icons :size="100" name="https://cdn.roundicons.com/wp-content/uploads/2017/09/Lego-freebie-icon.png"></tm-icons>
<tm-icons :size="100" name="https://cdn.roundicons.com/wp-content/uploads/2017/09/Candles-freebie-icon.png"></tm-icons>
<tm-icons :size="100" name="https://cdn.roundicons.com/wp-content/uploads/2017/09/Box-freebie-icon-1.png"></tm-icons>
<tm-icons :size="100" name="https://cdn.roundicons.com/wp-content/uploads/2017/09/Present-freebie-icon.png"></tm-icons>
<tm-icons :size="100" name="https://cdn.roundicons.com/wp-content/uploads/2017/09/Flag-freebie-icon.png"></tm-icons>
</tm-sheet>
<tm-sheet>
<view class="text-size-s text-weight-b mb-24">其它组件上应用图标</view>
<tm-listitem :margin="[0,32]" title="应用图标" :show-left-icon="true" left-icon="https://cdn.roundicons.com/wp-content/uploads/2017/09/Lego-freebie-icon.png"></tm-listitem>
<view class="flex-between">
<tm-button icon="icon-paperplane-fill" theme="bg-gradient-blue-accent">飞信</tm-button>
<tm-button :icon-size="60" icon="https://cdn.roundicons.com/wp-content/uploads/2017/09/Candles-freebie-icon.png" theme="white">飞信</tm-button>
</view>
</tm-sheet>
</view>
</template>
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
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
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
👉props属性表
属性名称 | 类型 | 可选值 | 默认值 | 说明 |
---|---|---|---|---|
color | String | 任意主题色名称 | primary | 图标主题颜色名 |
name | String | 图标名称 | '' | 图标名称,注意不带前缀。也可是网格或者本地图片地址 |
prefx | String | iconfont | iconfont | 图标的前缀 |
size | Number | 任意整数 | 28 | 图标大小 单位是upx |
dense | Boolean | true/false | false | 是否去除边距 |
👉事件
事件名称 | 返回参数 | 返参类型 | 说明 |
---|---|---|---|
@click | - | - | 图标点击事件。 |
👉更新日志
2021年8月20日14:8:5 初始版本。