Skip to content

Commit

Permalink
fix: uploader 使用 isDeletable 无法隐藏 删除按钮 (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
junjun666 authored Oct 25, 2022
1 parent 5eaa446 commit 5040467
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
18 changes: 10 additions & 8 deletions src/packages/uploader/uploader.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,16 @@ const InternalUploader: ForwardRefRenderFunction<
/>
&nbsp;{item.name}
</div>
<Icon
classPrefix={props.iconClassPrefix}
fontClassName={props.iconFontClassName}
color="#808080"
className="nut-uploader__preview-img__file__del"
name="del"
onClick={() => onDelete(item, index)}
/>
{isDeletable && (
<Icon
classPrefix={props.iconClassPrefix}
fontClassName={props.iconFontClassName}
color="#808080"
className="nut-uploader__preview-img__file__del"
name="del"
onClick={() => onDelete(item, index)}
/>
)}
{item.status === 'uploading' && (
<Progress
size="small"
Expand Down
19 changes: 11 additions & 8 deletions src/packages/uploader/uploader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -532,14 +532,17 @@ const InternalUploader: ForwardRefRenderFunction<
/>
&nbsp;{item.name}
</div>
<Icon
classPrefix={iconClassPrefix}
fontClassName={iconFontClassName}
color="#808080"
className="nut-uploader__preview-img__file__del"
name="del"
onClick={() => onDelete(item, index)}
/>
{isDeletable && (
<Icon
classPrefix={iconClassPrefix}
fontClassName={iconFontClassName}
color="#808080"
className="nut-uploader__preview-img__file__del"
name="del"
onClick={() => onDelete(item, index)}
/>
)}

{item.status === 'uploading' && (
<Progress
size="small"
Expand Down

0 comments on commit 5040467

Please sign in to comment.