Skip to content

Commit

Permalink
fix(popup): fix popup default slot
Browse files Browse the repository at this point in the history
resolve #206
  • Loading branch information
Perisiguiendo committed Mar 7, 2022
1 parent a87c9ee commit f392349
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 4 additions & 1 deletion example/pages/popup/popup.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ page .demo-block__oper {
.block {
width: 176rpx;
height: 176rpx;
border-radius: 8rpx;
background: #fff;
color: #333;
display: flex;
Expand All @@ -42,6 +41,10 @@ page .demo-block__oper {
border-radius: 0;
}

&--middle {
border-radius: 16rpx;
}

&--top {
width: 100vw;
height: 35vh;
Expand Down
10 changes: 5 additions & 5 deletions example/pages/popup/popup.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
<view class="tdesign-demo-popup">
<t-demo title="01 类型" operList="{{operList}}" bindclickoper="clickHandle">
<t-popup visible="{{top}}" bind:visible-change="onVisibleChange" placement="top">
<view slot="content" class="block block--top" />
<view class="block block--top" />
</t-popup>
<t-popup
visible="{{bottom}}"
bind:visible-change="onVisibleChange"
placement="bottom"
close-btn
>
<view slot="content" class="block block--bottom" />
<view class="block block--bottom" />
</t-popup>
<t-popup visible="{{center}}" bind:visible-change="onVisibleChange" placement="center">
<view slot="content" class="block" />
<view class="block block--middle" />
</t-popup>
<t-popup visible="{{left}}" bind:visible-change="onVisibleChange" placement="left">
<view slot="content" class="block block--left" />
<view class="block block--left" />
</t-popup>
<t-popup visible="{{right}}" bind:visible-change="onVisibleChange" placement="right">
<view slot="content" class="block block--right" />
<view class="block block--right" />
</t-popup>
</t-demo>
</view>
3 changes: 1 addition & 2 deletions src/popup/popup.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
style="z-index:{{zIndex -1}}"
/>
<view class="{{classPrefix}}__content {{prefix}}-class-content" style="z-index:{{zIndex}}">
{{content}}
<view class="{{classPrefix}}__close">
<t-icon name="close" wx:if="{{closeBtn}}" bind:tap="onCloseClick" size="64rpx" />
<slot name="closeBtn" class="{{classPrefix}}-slot" />
</view>
<slot name="content" />
<slot />
</view>
</t-transition>

0 comments on commit f392349

Please sign in to comment.