Skip to content

Commit b7c3d08

Browse files
author
Dewyzee
committed
add icon component
1 parent a1dd343 commit b7c3d08

File tree

5 files changed

+339
-4
lines changed

5 files changed

+339
-4
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "iview-weapp",
3-
"version": "2.0.0",
4-
"description": "高质量微信小程序 UI 组件库",
2+
"name": "iview-mpvue",
3+
"version": "1.0.0",
4+
"description": "高质量小程序 UI 组件库",
55
"main": "app.js",
66
"directories": {
77
"example": "example"
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "git+ssh://git@github.com:iview/iview-weapp.git"
1717
},
18-
"author": "Aresn",
18+
"author": "Aresn, hucq, Dewyzee",
1919
"license": "MIT",
2020
"bugs": {
2121
"url": "https://github.com/iview/iview-weapp/issues"

src/components/icon/icon.vue

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<template>
2+
<div>
3+
<div class="i-class i-icon" v-bind:class="classObj" v-bind:style="{color: color, fontSize: size + 'px'}"></div>
4+
</div>
5+
</template>
6+
<script>
7+
export default {
8+
props: {
9+
type: {
10+
type: String,
11+
value: ''
12+
},
13+
custom: {
14+
type: String,
15+
value: ''
16+
},
17+
size: {
18+
type: Number,
19+
value: 14
20+
},
21+
color: {
22+
type: String,
23+
value: ''
24+
}
25+
},
26+
computed: {
27+
classObj() {
28+
const iconType = this.type ? 'i-icon-' + this.type : ''
29+
const custom = this.custom ? this.custom : ''
30+
return iconType + ' ' + custom
31+
}
32+
},
33+
}
34+
</script>
35+

src/components/icon/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import icon from 'icon.vue'
2+
3+
export default icon

0 commit comments

Comments
 (0)