Skip to content

Commit 6faeac7

Browse files
committed
fix: fix console warnings caused by button template
1 parent 7dc495e commit 6faeac7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/common/template/button.wxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template name="button">
22
<t-button
33
t-id="{{tId || ''}}"
4-
style="{{style}}"
4+
style="{{style || ''}}"
55
block="{{block || false}}"
66
class="{{rootClass || ''}}"
77
t-class="{{tClass}}"
@@ -12,7 +12,7 @@
1212
content="{{content || ''}}"
1313
icon="{{icon || ''}}"
1414
loading="{{loading || false}}"
15-
loading-props="{{loadingProps}}"
15+
loading-props="{{loadingProps || null }}"
1616
theme="{{theme || 'default'}}"
1717
ghost="{{ghost || false}}"
1818
shape="{{shape || 'rectangle'}}"
@@ -40,6 +40,6 @@
4040
bind:agreeprivacyauthorization="onTplButtonTap"
4141
aria-label="{{ariaLabel || ''}}"
4242
>
43-
<slot />
43+
<slot wx:if="{{useDefaultSlot || false}}" />
4444
</t-button>
4545
</template>

src/fab/template/draggable.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
bind:move="onMove"
1111
bind:end="onEnd"
1212
>
13-
<template is="button" data="{{...buttonData}}" />
13+
<template is="button" data="{{useDefaultSlot: true, ...buttonData}}" />
1414
</t-draggable>
1515
</template>

src/fab/template/view.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
class="{{classPrefix}} class {{prefix}}-class"
77
style="right: 16px; bottom: 32px; {{_._style([style, customStyle])}}"
88
>
9-
<template is="button" data="{{...buttonData}}" />
9+
<template is="button" data="{{useDefaultSlot: true, ...buttonData}}" />
1010
</view>
1111
</template>

0 commit comments

Comments
 (0)