docs: add watermark faq (#50307)

This commit is contained in:
二货爱吃白萝卜 2024-08-08 17:03:07 +08:00 committed by GitHub
parent 6c6111a62c
commit dd3bfae425
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View File

@ -77,3 +77,11 @@ When using an image watermark and the image loads abnormally, you can add `conte
<div style={{ height: 500 }} />
</Watermark>
```
### Why `overflow: hidden` style is added since version 5.18.0?
User can hide the watermark by setting the container height to 0 through the developer tool in the previous version. To avoid this situation, we added the `overflow: hidden` style to the container. When the container height changes, the content is also hidden. You can override the style to modify this behavior:
```tsx
<Watermark style={{ overflow: 'visible' }} />
```

View File

@ -78,3 +78,11 @@ tag: 5.1.0
<div style={{ height: 500 }} />
</Watermark>
```
### 从 5.18.0 版本后,为什么添加了 `overflow: hidden` 样式?
在之前版本,用户可以通过开发者工具将容器高度设置为 0 来隐藏水印,为了避免这种情况,我们在容器上添加了 `overflow: hidden` 样式。当容器高度变化时,则内容也一同被隐藏。你可以通过覆盖样式来修改这个行为:
```tsx
<Watermark style={{ overflow: 'visible' }} />
```