Skip to content

Commit 1bd7fb9

Browse files
authored
Fix card divier (#1378)
* fix: card divider * fix: button add loading * fix: aide button in wechat platform
1 parent 18b6eb6 commit 1bd7fb9

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

src/Button/index.axml

+12-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
catchTap="{{ catchTap ? 'catchTap' : '' }}"
1515
public-id="{{ publicId }}"
1616
open-type="{{ openType }}"
17-
class="ant-button {{ inline ? 'ant-button-inline ' + utils.getClass(size) : '' }} {{ 'ant-button-' + type + (danger ? '-danger' : ( aide && ['default', 'primary'].indexOf(type) > -1 ? '-aide' : '' )) }} {{ disabled || loading ? 'ant-button-disabled' : '' }} {{ className ? className : '' }}"
17+
class="ant-button {{ inline ? 'ant-button-inline ' + utils.getClass(size) : '' }} {{ 'ant-button-' + type + (danger ? '-danger' : (utils.isAide(aide, type) ? '-aide' : '' )) }} {{ disabled || loading ? 'ant-button-disabled' : '' }} {{ className ? className : '' }}"
1818
style="{{ style }}"
1919
>
2020
<!-- #endif -->
@@ -34,7 +34,7 @@
3434
bindchooseavatar="onChooseAvatar"
3535
public-id="{{ publicId }}"
3636
open-type="{{ openType }}"
37-
class="ant-button {{ inline ? 'ant-button-inline ' + utils.getClass(size) : '' }} {{ 'ant-button-' + type + (danger ? '-danger' : '') }} {{ disabled || loading ? 'ant-button-disabled' : '' }} {{ className ? className : '' }}"
37+
class="ant-button {{ inline ? 'ant-button-inline ' + utils.getClass(size) : '' }} {{ 'ant-button-' + type + (danger ? '-danger' : (utils.isAide(aide, type) ? '-aide' : '' )) }} {{ disabled || loading ? 'ant-button-disabled' : '' }} {{ className ? className : '' }}"
3838
style="{{ style }}"
3939
>
4040
<!-- #endif -->
@@ -46,5 +46,15 @@
4646
{{ subText }}
4747
</view>
4848
</view>
49+
<view
50+
a:if="{{loading}}"
51+
class="ant-button-content-loading-container"
52+
>
53+
<loading
54+
type="mini"
55+
color="currentColor"
56+
className="ant-button-content-loading"
57+
></loading>
58+
</view>
4959
</view>
5060
</button>

src/Button/index.sjs.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function getClass(size) {
22
const list = ['small', 'medium', 'large'];
3-
if (list.indexOf(size) >=0) {
3+
if (list.indexOf(size) >= 0) {
44
return `ant-button-${size}`;
55
}
66
return 'ant-button-medium';
@@ -20,5 +20,8 @@ function getHoverClass(loading, type, activeClassName) {
2020
return className;
2121
}
2222

23+
function isAide(aide, type) {
24+
return aide && ['default', 'primary'].indexOf(type) > -1;
25+
}
2326

24-
export default { getClass, getHoverClass };
27+
export default { getClass, getHoverClass, isAide };

src/Button/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Component({
2929
type: String,
3030
value: 'default',
3131
},
32+
aide: {
33+
type: Boolean,
34+
value: false,
35+
},
3236
},
3337
options: {
3438
styleIsolation: 'shared',

0 commit comments

Comments
 (0)