Skip to content

Commit 50115da

Browse files
committed
fix: icon type change will cause error when icon undefined
1 parent a3a6694 commit 50115da

21 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "weui-miniprogram",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "小程序 WeUI 组件库",
55
"main": "miniprogram_dist/index.js",
66
"files": [

src/icon/icon.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ Component({
4444
this._genSrc(iconData[v][getFixedIconType(this.data.type)])
4545
},
4646
_genSrcByType(v) {
47-
this._genSrc(iconData[this.data.icon][getFixedIconType(v)])
47+
const iconDataItem = iconData[this.data.icon]
48+
if (iconDataItem) this._genSrc(iconDataItem[getFixedIconType(v)])
4849
},
4950
_genSrc(rawData) {
5051
if (!rawData) return // type 不存在

src/static/icon/s-arrow-back.png

-1 Bytes
Loading
-1 Bytes
Loading
-1 Bytes
Loading
-4 Bytes
Loading
-1 Bytes
Loading
-1 Bytes
Loading
-1 Bytes
Loading
-1 Bytes
Loading

0 commit comments

Comments
 (0)