Skip to content

Commit e46324e

Browse files
committed
fix(Attachments): fix file margin-top erro
1 parent 26bb36c commit e46324e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/pro-components/chat/attachments/attachments.less

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,15 @@
9191
// 文件项样式
9292
&__file {
9393
border-radius: @radius-extraLarge;
94-
margin-top: @attachments-file-margin-tiny;
9594
display: block;
9695
position: relative;
9796
background-color: @attachments-background-color;
9897

98+
// 仅当有删除按钮时,增加上边距
99+
&--removable {
100+
margin-top: @attachments-file-margin-tiny;
101+
}
102+
99103
// 删除按钮样式
100104
.@{attachments}__remove {
101105
background-color: @text-color-primary;

packages/pro-components/chat/attachments/attachments.wxml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<block wx:for="{{files}}" wx:for-item="item" wx:for-index="index" wx:key="index">
1111
<view class="{{classPrefix}}__files" bindtap="onFileWrapTap" data-index="{{index}}">
1212
<block wx:if="{{item.fileType==='image'}}">
13-
<view class="file-image {{classPrefix}}__file">
13+
<view class="file-image {{classPrefix}}__file {{removable ? classPrefix + '__file--removable' : ''}}">
1414
<block wx:if="{{item.status==='pending' || item.status==='fail' || item.status==='error'}}">
1515
<view class="{{item.status}} {{classPrefix}}__file--{{item.status}}">
1616
<t-loading theme="circular" size="48rpx" />
@@ -20,7 +20,7 @@
2020
<image
2121
class="image"
2222
src="{{item.url}}"
23-
mode="{{ _this.getImageMode(item)}}"
23+
mode="{{_this.getImageMode(item)}}"
2424
lazy-load="false"
2525
style="{{inChat ? _this.imageStyle(item) : ''}}"
2626
></image>
@@ -31,7 +31,7 @@
3131
</view>
3232
</block>
3333
<block wx:else>
34-
<view class="file {{classPrefix}}__file">
34+
<view class="file {{classPrefix}}__file {{removable ? classPrefix + '__file--removable' : ''}}">
3535
<view class="image">
3636
<block wx:if="{{item.status==='pending'}}">
3737
<view class="loading {{classPrefix}}__file--pending">

0 commit comments

Comments
 (0)