Skip to content

Commit

Permalink
chore(preview): 代码优化(XiaoMi#2808)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiamiao committed May 10, 2024
1 parent 22d2eab commit e133da0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions packages/ui/preview/src/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const Preview = forwardRef<HTMLDivElement | null, PreviewProps>(
src,
watermarkProps,
disabledDownload = false,
disabledPortal = true,
},
ref
) => {
Expand Down Expand Up @@ -305,7 +304,7 @@ export const Preview = forwardRef<HTMLDivElement | null, PreviewProps>(
</>
)}
</div>
{!disabledPortal && (
{watermarkProps && (
<Watermark {...watermarkProps} container={watermarkContainerRef} />
)}
</>
Expand Down Expand Up @@ -337,10 +336,6 @@ export interface PreviewProps extends Omit<HiBaseHTMLProps<'div'>, 'onError'> {
* 当前预览图片索引
*/
defaultCurrent?: number
/**
* 禁止挂载水印
*/
disabledPortal?: boolean
/**
* 设置图片水印
*/
Expand Down
1 change: 0 additions & 1 deletion packages/ui/preview/stories/watermark.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const Watermark = () => {
onClose={() => {
setShowIndex(-1)
}}
disabledPortal={false}
watermarkProps={{
content: ['HiUI', '做中台,就用 HiUI'],
style: {
Expand Down

0 comments on commit e133da0

Please sign in to comment.