Skip to content

Commit

Permalink
fix: using correct slot name
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJim committed Dec 25, 2022
1 parent 8fe4a07 commit 6ff1df9
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
4 changes: 3 additions & 1 deletion src/avatar/_example/exhibition/index.wxml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<view class="demo-avatar">
<view class="avatar-example">
<t-avatar-group max="5" cascading="left-up" collapseAvatar="+5" size="medium">
<t-avatar-group cascading="left-up" size="medium">
<t-avatar wx:for="{{pics}}" wx:for-item="pic" wx:key="index" image="{{pic}}" bordered />
<view slot="collapseAvatar" class="camel">camel</view>
<view slot="collapse-avatar" class="kebe">kebe</view>
</t-avatar-group>
</view>
<view class="avatar-example">
Expand Down
2 changes: 1 addition & 1 deletion src/avatar/avatar-group.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<slot />
<!-- 自定义折叠元素 -->
<view class="{{classPrefix}}__collapse--slot {{collapseAvatar ? prefix + '-is-hidden' : ''}}">
<slot name="collapseAvatar" />
<slot name="collapse-avatar" />
</view>
<!-- 默认折叠元素 -->
<view class="{{classPrefix}}__collapse--default" wx:if="{{max && (max < length)}}">
Expand Down
2 changes: 1 addition & 1 deletion src/cascader/cascader.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{title}}
</view>
<view class="{{name}}__close-btn" bind:tap="hide">
<slot name="closeBtn" />
<slot name="close-btn" />
<t-icon wx:if="{{closeBtn}}" size="24" name="close" />
</view>
<view class="{{name}}__content">
Expand Down
4 changes: 2 additions & 2 deletions src/image-viewer/image-viewer.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
data-source="button"
bind:click="onClose"
></t-icon>
<slot name="closeBtn" />
<slot name="close-btn" />
<view wx:if="{{showIndex}}" class="{{classPrefix}}__nav-index">
{{currentSwiperIndex + 1}}/{{images.length}}
</view>
Expand All @@ -55,7 +55,7 @@
customStyle="{{deleteIconProps.customStyle}}"
bind:click="onDelete"
></t-icon>
<slot name="deleteBtn" />
<slot name="delete-btn" />
</view>
</block>
</view>
4 changes: 2 additions & 2 deletions src/input/input.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<view wx:if="{{prefixIconName || _.isNoEmptyObj(prefixIconData) || label}}" class="{{classPrefix}}__wrap--prefix">
<view wx:if="{{prefixIconName || _.isNoEmptyObj(prefixIconData)}}" class="{{classPrefix}}__icon--prefix">
<slot wx:if="{{prefixIconName === 'slot'}}" name="prefixIcon" />
<slot wx:if="{{prefixIconName === 'slot'}}" name="prefix-icon" />
<template
wx:else
is="icon"
Expand Down Expand Up @@ -89,7 +89,7 @@
is="icon"
data="{{tClass: prefix + '-class-suffix-icon', ariaRole: 'button', size: 24, name: suffixIconName, ...suffixIconData}}"
></template>
<slot wx:else name="suffixIcon" />
<slot wx:else name="suffix-icon" />
</view>
</view>
<view wx:if="{{tips && tips.length > 0}}" class="{{classPrefix}}__tips {{prefix}}-class-tips">{{tips}} </view>
Expand Down
4 changes: 2 additions & 2 deletions src/link/link.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
bindcomplete="onComplete"
>
<view wx:if="{{prefixIconName || _.isNoEmptyObj(prefixIconData)}}" class="{{classPrefix}}__prefix-icon">
<slot wx:if="{{prefixIconName === 'slot'}}" name="prefixIcon" />
<slot wx:if="{{prefixIconName === 'slot'}}" name="prefix-icon" />
<template
wx:else
is="icon"
Expand All @@ -33,7 +33,7 @@
<slot name="content" />
</view>
<view wx:if="{{suffixIconName || _.isNoEmptyObj(suffixIconData)}}" class="{{classPrefix}}__suffix-icon">
<slot wx:if="{{suffixIconName === 'slot'}}" name="suffixIcon" />
<slot wx:if="{{suffixIconName === 'slot'}}" name="suffix-icon" />
<template
wx:else
is="icon"
Expand Down
2 changes: 1 addition & 1 deletion src/message/message.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
class="{{classPrefix}}__icon--right"
bind:tap="handleClose"
>
<slot wx:if="{{closeBtnName === 'slot'}}" name="closeBtn" />
<slot wx:if="{{closeBtnName === 'slot'}}" name="close-btn" />
<template
wx:else
is="icon"
Expand Down
4 changes: 2 additions & 2 deletions src/notice-bar/notice-bar.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class="{{classPrefix}}__prefix-icon"
bind:tap="clickPrefixIcon"
>
<slot wx:if="{{prefixIconName === 'slot'}}" name="prefixIcon" />
<slot wx:if="{{prefixIconName === 'slot'}}" name="prefix-icon" />
<template
wx:else
is="icon"
Expand Down Expand Up @@ -57,7 +57,7 @@
class="{{classPrefix}}__suffix-icon"
bind:tap="clickSuffixIcon"
>
<slot wx:if="{{suffixIconName === 'slot'}}" name="suffixIcon" />
<slot wx:if="{{suffixIconName === 'slot'}}" name="suffix-icon" />
<template
wx:else
is="icon"
Expand Down
2 changes: 1 addition & 1 deletion src/popup/popup.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<view class="{{classPrefix}}__content {{prefix}}-class-content">
<view class="{{classPrefix}}__close" bind:tap="handleClose">
<t-icon name="close" wx:if="{{closeBtn}}" size="64rpx" />
<slot name="closeBtn" class="{{classPrefix}}-slot" />
<slot name="close-btn" class="{{classPrefix}}-slot" />
</view>
<slot name="content" />
<slot />
Expand Down
2 changes: 1 addition & 1 deletion src/upload/upload.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</view>
<!-- 删除 -->
<view class="{{classPrefix}}__close-btn hotspot-expanded" bindtap="onDelete" data-index="{{index}}">
<slot wx:if="{{deleteBtn === 'slot'}}" name="deleteBtn" />
<slot wx:if="{{deleteBtn === 'slot'}}" name="delete-btn" />
<t-icon wx:else name="close" size="16" color="#fff" />
</view>
</view>
Expand Down

0 comments on commit 6ff1df9

Please sign in to comment.