Skip to content

Commit 24aa269

Browse files
author
cunjinli
committed
0.1.2 调整
1 parent 36a87e6 commit 24aa269

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+297
-173
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": "0.0.1",
3+
"version": "0.1.2",
44
"description": "",
55
"main": "miniprogram_dist/index.js",
66
"scripts": {

src/badge/badge.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Component({
77
type: String,
88
value: ''
99
},
10-
dot: {
11-
type: Boolean,
12-
value: false,
10+
content: {
11+
type: String,
12+
value: ''
1313
}
1414
}
1515
})

src/badge/badge.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<view class="weui-badge {{extClass}} {{dot ? 'weui-badge_dot' : ''}}"><slot></slot></view>
1+
<view class="weui-badge {{extClass}} {{!content ? 'weui-badge_dot' : ''}}">{{content}}</view>

src/cell/cell.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Component({
1616
type: String,
1717
value: ''
1818
},
19-
icon: {
19+
iconClass: {
2020
type: String,
21-
value: '',
21+
value: ''
2222
},
23-
iconClass: {
23+
icon: {
2424
type: String,
2525
value: '',
2626
},
@@ -32,10 +32,6 @@ Component({
3232
type: String,
3333
value: '',
3434
},
35-
valueClass: {
36-
type: String,
37-
value: ''
38-
},
3935
showError: {
4036
type: Boolean,
4137
value: false
@@ -48,11 +44,11 @@ Component({
4844
type: String,
4945
value: ''
5046
},
51-
foot: {
47+
footerClass: {
5248
type: String,
5349
value: ''
5450
},
55-
footClass: {
51+
footer: {
5652
type: String,
5753
value: ''
5854
},

src/cell/cell.wxml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<block wx:if="{{link}}">
22
<view bindtap="navigateTo" class="weui-cell weui-cell_access {{extClass}} {{outerClass}}{{inForm ? ' weui-cell-inform' : ''}}{{inline ? '' : ' .weui-cell_label-block'}}" hover-class="{{hover ? 'weui-cell_active' : ''}}">
3-
<view class="weui-cell__hd">
3+
<view class="weui-cell__hd {{iconClass}}">
44
<block wx:if="{{icon}}">
55
<image src="{{icon}}" class="weui-cell__icon" mode="aspectFit"></image>
66
</block>
@@ -26,10 +26,10 @@
2626
<slot></slot>
2727
</block>
2828
</view>
29-
<view class="weui-cell__ft weui-cell__ft_in-access">
30-
<block wx:if="{{foot}}">{{foot}}</block>
29+
<view class="weui-cell__ft weui-cell__ft_in-access {{footerClass}}">
30+
<block wx:if="{{footer}}">{{footer}}</block>
3131
<block wx:else>
32-
<slot name="foot"></slot>
32+
<slot name="footer"></slot>
3333
</block>
3434
</view>
3535
</view>
@@ -56,16 +56,16 @@
5656
</block>
5757
</block>
5858
</view>
59-
<view class="weui-cell__bd {{valueClass}}">
59+
<view class="weui-cell__bd">
6060
<block wx:if="{{value}}">{{value}}</block>
6161
<block wx:else>
6262
<slot></slot>
6363
</block>
6464
</view>
65-
<view class="weui-cell__ft {{footClass}}">
66-
<block wx:if="{{foot}}">{{foot}}</block>
65+
<view class="weui-cell__ft {{footerClass}}">
66+
<block wx:if="{{footer}}">{{footer}}</block>
6767
<block wx:else>
68-
<slot name="foot"></slot>
68+
<slot name="footer"></slot>
6969
</block>
7070
<icon wx:if="{{showError && error}}" type="warn" size="23" color="#E64340"></icon>
7171
</view>

src/cells/cells.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Component({
1212
type: String,
1313
value: ''
1414
},
15-
foot: {
15+
footer: {
1616
type: String,
1717
value: ''
1818
}

src/cells/cells.wxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<view class="weui-cells weui-cells_after-title {{checkboxCount > 0 && checkboxIsMulti ? 'weui-cells_checkbox' : ''}}">
44
<slot></slot>
55
</view>
6-
<view v-if="{{foot}}" class="weui-cells__tips">{{foot}}</view>
7-
<template v-else><slot name="foot"></slot></template>
6+
<view v-if="{{footer}}" class="weui-cells__tips">{{footer}}</view>
7+
<template v-else><slot name="footer"></slot></template>
88
</view>

src/checkbox-group/checkbox-group.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Component({
88
extClass: {
99
type: String,
1010
value: '',
11+
},
12+
prop: {
13+
type: String,
14+
value: ''
1115
}
1216
},
1317
data: {

src/checkbox/checkbox.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"component": true,
33
"usingComponents": {
4-
"mp-cell": "../cell/cell"
4+
"mp-cell": "../cell/cell",
5+
"mp-checkbox-group": "../checkbox-group/checkbox-group"
56
}
67
}

src/checkbox/checkbox.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Component<any>({
1616
type: String,
1717
value: '',
1818
},
19-
disabled: {
20-
type: Boolean,
21-
value: false,
22-
},
23-
color: {
24-
type: String,
25-
value: '#09BB07',
26-
},
19+
// disabled: {
20+
// type: Boolean,
21+
// value: false,
22+
// },
23+
// color: {
24+
// type: String,
25+
// value: '#09BB07',
26+
// },
2727
label: {
2828
type: String,
2929
value: 'label',
@@ -64,15 +64,20 @@ Component<any>({
6464
this.setData({
6565
checked
6666
})
67-
this.data.group.checkedChange(checked, this)
67+
if (this.data.group) {
68+
this.data.group.checkedChange(checked, this)
69+
}
6870
} else {
6971
const checked = this.data.checked
7072
if (checked) return
7173
this.setData({
7274
checked: true
7375
})
74-
this.data.group.checkedChange(checked, this)
76+
if (this.data.group) {
77+
this.data.group.checkedChange(checked, this)
78+
}
7579
}
80+
this.triggerEvent('change', {value: this.data.value, checked: this.data.checked})
7681
}
7782
}
7883
})

0 commit comments

Comments
 (0)