Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix console warnings caused by template #1548

Merged
merged 4 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/avatar/avatar.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
style="{{_._style([this.getStyles(isShow, zIndex), style, customStyle])}}"
>
<t-badge
color="{{badgeProps.color}}"
content="{{badgeProps.content}}"
count="{{badgeProps.count}}"
dot="{{badgeProps.dot}}"
color="{{badgeProps.color || ''}}"
content="{{badgeProps.content || ''}}"
count="{{badgeProps.count || 0}}"
dot="{{badgeProps.dot || false}}"
max-count="{{badgeProps.maxCount || 99}}"
offset="{{badgeProps.offset}}"
offset="{{badgeProps.offset || []}}"
shape="{{badgeProps.shape || 'circle'}}"
show-zero="{{badgeProps.showZero}}"
show-zero="{{badgeProps.showZero || false}}"
size="{{badgeProps.size || 'medium'}}"
t-class="{{badgeProps.tClass}}"
t-class-content="{{badgeProps.tClassContent}}"
Expand All @@ -31,14 +31,14 @@
wx:if="{{image}}"
t-class="{{prefix}}-image {{classPrefix}}__image"
t-class-load="{{prefix}}-class-alt"
style="{{imageProps.style}}"
style="{{imageProps.style || ''}}"
src="{{image}}"
mode="{{imageProps.mode || 'aspectFill'}}"
lazy="{{imageProps.lazy}}"
loading="{{imageProps.loading}}"
lazy="{{imageProps.lazy || false}}"
loading="{{imageProps.loading || 'default'}}"
shape="{{imageProps.shape || 'round'}}"
webp="{{imageProps.webp}}"
error="{{alt}}"
webp="{{imageProps.webp || false}}"
error="{{alt || 'default'}}"
bind:error="onLoadError"
/>
<template
Expand Down
6 changes: 3 additions & 3 deletions src/button/button.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
inheritColor="{{loadingProps.indicator || false}}"
layout="{{loadingProps.layout || 'horizontal'}}"
pause="{{loadingProps.pause || false}}"
progress="{{loadingProps.progress}}"
reverse="{{loadingProps.reverse}}"
progress="{{loadingProps.progress || 0}}"
reverse="{{loadingProps.reverse || false}}"
size="{{loadingProps.size || '40rpx'}}"
text="{{loadingProps.text }}"
text="{{loadingProps.text || '' }}"
theme="{{loadingProps.theme || 'circular'}}"
loading
t-class="{{classPrefix}}__loading {{classPrefix}}__loading--wrapper"
Expand Down
8 changes: 4 additions & 4 deletions src/calendar/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ exports[`calendar :base 1`] = `
ariaLabel="关闭"
ariaRole="button"
class="t-icon class t-class"
style="font-size: 24px;"
style="color: inherit; font-size: 24px;"
bind:tap="onTap"
>
<wx-label
Expand Down Expand Up @@ -756,10 +756,10 @@ exports[`calendar :base 1`] = `
data-custom="{{null}}"
formType=""
hoverClass="t-button--hover"
hoverStartTime="{{0}}"
hoverStayTime="{{0}}"
hoverStartTime="{{20}}"
hoverStayTime="{{70}}"
hoverStopPropagation="{{false}}"
lang=""
lang="en"
openType=""
sendMessageImg=""
sendMessagePath=""
Expand Down
2 changes: 1 addition & 1 deletion src/cell/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ exports[`cell :base 1`] = `
ariaLabel=""
ariaRole=""
class="t-icon class t-class"
style=""
style="color: inherit; font-size: inherit;"
bind:tap="onTap"
>
<wx-label
Expand Down
4 changes: 2 additions & 2 deletions src/collapse/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ exports[`collapse :defaultExpandAll 1`] = `
ariaLabel=""
ariaRole=""
class="t-icon class t-class"
style=""
style="color: inherit; font-size: inherit;"
bind:tap="onTap"
>
<wx-label
Expand Down Expand Up @@ -150,7 +150,7 @@ exports[`collapse :defaultExpandAll 1`] = `
ariaLabel=""
ariaRole=""
class="t-icon class t-class"
style=""
style="color: inherit; font-size: inherit;"
bind:tap="onTap"
>
<wx-label
Expand Down
10 changes: 5 additions & 5 deletions src/common/template/badge.wxml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template name="badge">
<t-badge
color="{{color}}"
content="{{content}}"
color="{{color || ''}}"
content="{{content || ''}}"
count="{{count || 0}}"
dot="{{dot}}"
dot="{{dot || false}}"
max-count="{{maxCount || 99}}"
offset="{{offset}}"
offset="{{offset || []}}"
shape="{{shape || 'circle'}}"
show-zero="{{showZero}}"
show-zero="{{showZero || false}}"
size="{{size || 'medium'}}"
t-class="{{class}} {{tClass}}"
t-class-content="{{tClassContent}}"
Expand Down
44 changes: 22 additions & 22 deletions src/common/template/button.wxml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<template name="button">
<t-button
block="{{block}}"
class="{{class}}"
block="{{block || false}}"
class="{{class || ''}}"
t-class="{{externalClass}}"
disabled="{{disabled}}"
disabled="{{disabled || false}}"
data-type="{{type}}"
data-extra="{{extra}}"
icon="{{icon}}"
loading="{{loading}}"
theme="{{theme}}"
ghost="{{ghost}}"
shape="{{shape}}"
size="{{size}}"
variant="{{variant}}"
open-type="{{openType}}"
hover-stop-propagation="{{hoverStopPropagation}}"
hover-start-time="{{hoverStartTime}}"
hover-stay-time="{{hoverStayTime}}"
lang="{{lang}}"
session-from="{{sessionFrom}}"
send-message-title="{{sendMessageTitle}}"
send-message-path="{{sendMessagePath}}"
send-message-img="{{sendMessageImg}}"
app-parameter="{{appParameter}}"
show-message-card="{{showMessageCard}}"
icon="{{icon || ''}}"
loading="{{loading || false}}"
theme="{{theme || 'default'}}"
ghost="{{ghost || false}}"
shape="{{shape || 'rectangle'}}"
size="{{size || 'medium'}}"
variant="{{variant || 'base'}}"
open-type="{{openType || ''}}"
hover-stop-propagation="{{hoverStopPropagation || false}}"
hover-start-time="{{hoverStartTime || 20}}"
hover-stay-time="{{hoverStayTime || 70}}"
lang="{{lang || 'en'}}"
session-from="{{sessionFrom || ''}}"
send-message-title="{{sendMessageTitle || ''}}"
send-message-path="{{sendMessagePath || ''}}"
send-message-img="{{sendMessageImg || ''}}"
app-parameter="{{appParameter || ''}}"
show-message-card="{{showMessageCard || false}}"
bind:tap="onTplButtonTap"
bind:getuserinfo="onTplButtonTap"
bind:contact="onTplButtonTap"
bind:getphonenumber="onTplButtonTap"
bind:error="onTplButtonTap"
bind:opensetting="onTplButtonTap"
bind:launchapp="onTplButtonTap"
aria-label="{{ariaLabel}}"
aria-label="{{ariaLabel || ''}}"
>{{content}}</t-button
>
</template>
16 changes: 8 additions & 8 deletions src/common/template/icon.wxml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template name="icon">
<t-icon
style="{{style}}"
style="{{style || ''}}"
class="{{class}}"
t-class="{{tClass}}"
prefix="{{prefix}}"
name="{{name}}"
size="{{size}}"
color="{{color}}"
aria-hidden="{{ariaHidden}}"
aria-label="{{ariaLabel}}"
aria-role="{{ariaRole}}"
prefix="{{prefix || ''}}"
name="{{name || ''}}"
size="{{size || 'inherit'}}"
color="{{color || 'inherit'}}"
aria-hidden="{{ariaHidden || '' }}"
aria-label="{{ariaLabel || ''}}"
aria-role="{{ariaRole || ''}}"
bind:click="{{bindclick || ''}}"
/>
</template>
10 changes: 5 additions & 5 deletions src/common/template/image.wxml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template name="image">
<t-image
style="{{style}}"
style="{{style || ''}}"
error="{{error || 'default'}}"
lazy="{{lazy}}"
lazy="{{lazy || false}}"
loading="{{count || 'default'}}"
shape="{{shape || 'square'}}"
src="{{src}}"
src="{{src || ''}}"
mode="{{mode || 'scaleToFill'}}"
webp="{{webp}}"
showMenuByLongpress="{{showMenuByLongpress}}"
webp="{{webp || false}}"
showMenuByLongpress="{{showMenuByLongpress || false}}"
bind:error="{{binderror}}"
bind:load="{{bindload}}"
t-class="{{class}} {{tClass}}"
Expand Down
4 changes: 2 additions & 2 deletions src/date-time-picker/_example/time/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<t-cell
title="选择时间"
hover
note="{{secondText}}"
note="{{secondText || ''}}"
arrow
data-mode="second"
bindtap="showPicker"
Expand All @@ -13,7 +13,7 @@
<t-cell
title="选择时间"
hover
note="{{minuteText}}"
note="{{minuteText || ''}}"
arrow
data-mode="minute"
bindtap="showPicker"
Expand Down
50 changes: 4 additions & 46 deletions src/drawer/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`Drawer Drawer base demo works fine 1`] = `
基础抽屉
</t-button>
<t-drawer
items=""
items="{{Array []}}"
placement="left"
visible=""
bind:item-click="itemClick"
Expand All @@ -33,49 +33,7 @@ exports[`Drawer Drawer footer demo works fine 1`] = `
带底部插槽
</t-button>
<t-drawer
items="{{
Array [
Object {
"title": "菜单一",
},
Object {
"title": "菜单二",
},
Object {
"title": "菜单三",
},
Object {
"title": "菜单四",
},
Object {
"title": "菜单五",
},
Object {
"title": "菜单六",
},
Object {
"title": "菜单七",
},
Object {
"title": "菜单八",
},
Object {
"title": "菜单四",
},
Object {
"title": "菜单五",
},
Object {
"title": "菜单六",
},
Object {
"title": "菜单七",
},
Object {
"title": "菜单八",
},
]
}}"
items="{{Array []}}"
LeeJim marked this conversation as resolved.
Show resolved Hide resolved
placement="left"
title="标题"
visible="{{false}}"
Expand Down Expand Up @@ -110,7 +68,7 @@ exports[`Drawer Drawer icon-drawer demo works fine 1`] = `
带图标抽屉
</t-button>
<t-drawer
items=""
items="{{Array []}}"
placement="left"
visible=""
bind:item-click="itemClick"
Expand All @@ -131,7 +89,7 @@ exports[`Drawer Drawer title demo works fine 1`] = `
带标题抽屉
</t-button>
<t-drawer
items=""
items="{{Array []}}"
placement="left"
title="标题"
visible=""
Expand Down
1 change: 1 addition & 0 deletions src/drawer/_example/base/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Component({
data: {
placement: 'left',
sidebar: [],
baseSidebar: [
{
title: '菜单一',
Expand Down
1 change: 1 addition & 0 deletions src/drawer/_example/footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Component({
data: {
visible: false,
placement: 'left',
sidebar: [],
baseSidebar: [
{
title: '菜单一',
Expand Down
2 changes: 1 addition & 1 deletion src/drawer/_example/footer/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
visible="{{visible}}"
placement="{{placement}}"
title="标题"
items="{{baseSidebar}}"
items="{{sidebar}}"
bind:overlay-click="overlayClick"
bind:item-click="itemClick"
>
Expand Down
1 change: 1 addition & 0 deletions src/drawer/_example/icon-drawer/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Component({
data: {
placement: 'left',
sidebar: [],
iconSidebar: [
{
title: '菜单一',
Expand Down
1 change: 1 addition & 0 deletions src/drawer/_example/title/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Component({
data: {
placement: 'left',
sidebar: [],
baseSidebar: [
{
title: '菜单一',
Expand Down
1 change: 0 additions & 1 deletion src/grid-item/grid-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default class GridItem extends SuperComponent {
gridItemWrapperStyle: '',
gridItemContentStyle: '',
align: 'center',
layout: 'vertical',
column: 0,
labelID: '',
};
Expand Down
12 changes: 6 additions & 6 deletions src/grid-item/grid-item.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
<slot />
<t-badge
wx:if="{{image || icon}}"
color="{{badgeProps.color}}"
content="{{badgeProps.content}}"
count="{{badgeProps.count}}"
dot="{{badgeProps.dot}}"
color="{{badgeProps.color || ''}}"
content="{{badgeProps.content || ''}}"
count="{{badgeProps.count || 0}}"
dot="{{badgeProps.dot || false}}"
max-count="{{badgeProps.maxCount || 99}}"
offset="{{badgeProps.offset}}"
offset="{{badgeProps.offset || []}}"
shape="{{badgeProps.shape || 'circle'}}"
show-zero="{{badgeProps.showZero}}"
show-zero="{{badgeProps.showZero || false}}"
size="{{badgeProps.size || 'medium'}}"
t-class="{{badgeProps.tClass}}"
t-class-content="{{badgeProps.tClassContent}}"
Expand Down
Loading