commit | author | age
|
9bcb19
|
1 |
IconSelector |
I |
2 |
==== |
|
3 |
|
|
4 |
> 图标选择组件,常用于为某一个数据设定一个图标时使用 |
|
5 |
> eg: 设定菜单列表时,为每个菜单设定一个图标 |
|
6 |
|
|
7 |
该组件由 [@Saraka](https://github.com/saraka-tsukai) 封装 |
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
### 使用方式 |
|
12 |
|
|
13 |
```vue |
|
14 |
<template> |
|
15 |
<div> |
|
16 |
<icon-selector @change="handleIconChange"/> |
|
17 |
</div> |
|
18 |
</template> |
|
19 |
|
|
20 |
<script> |
|
21 |
import IconSelector from '@/components/IconSelector' |
|
22 |
|
|
23 |
export default { |
|
24 |
name: 'YourView', |
|
25 |
components: { |
|
26 |
IconSelector |
|
27 |
}, |
|
28 |
data () { |
|
29 |
return { |
|
30 |
} |
|
31 |
}, |
|
32 |
methods: { |
|
33 |
handleIconChange (icon) { |
|
34 |
console.log('change Icon', icon) |
|
35 |
} |
|
36 |
} |
|
37 |
} |
|
38 |
</script> |
|
39 |
``` |
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
### 事件 |
|
44 |
|
|
45 |
|
|
46 |
| 名称 | 说明 | 类型 | 默认值 | |
|
47 |
| ------ | -------------------------- | ------ | ------ | |
|
48 |
| change | 当改变了 `icon` 选中项触发 | String | - | |