diff --git a/packages/vant/src/popup/README.md b/packages/vant/src/popup/README.md index 3e311736c..338d30aa8 100644 --- a/packages/vant/src/popup/README.md +++ b/packages/vant/src/popup/README.md @@ -44,10 +44,37 @@ export default { ### Position -Use `position` prop to set popup display position. +Use `position` prop to set Popup display position. + +The default position is `center`, it can be set to `top`, `bottom`, `left`, `right`. + +- When the position is `top` or `bottom`, the default width is consistent with the screen width, and the height of the Popup depends on the height of the content. +- When the position is `left` or `right` side, the width and height are not set by default, and the width and height of the popup depend on the width and height of the content. ```html - + + + + + + + + + + + ``` ### Close Icon diff --git a/packages/vant/src/popup/README.zh-CN.md b/packages/vant/src/popup/README.zh-CN.md index ff2a37d79..eb92b3109 100644 --- a/packages/vant/src/popup/README.zh-CN.md +++ b/packages/vant/src/popup/README.zh-CN.md @@ -46,10 +46,35 @@ export default { ### 弹出位置 -通过 `position` 属性设置弹出位置,默认居中弹出,可以设置为 `top`、`bottom`、`left`、`right`。 +通过 `position` 属性设置弹窗的弹出位置,默认为居中弹出,可以设置为 `top`、`bottom`、`left`、`right`。 + +- 当弹窗从顶部或底部弹出时,默认宽度与屏幕宽度保持一致,弹窗高度取决于内容的高度。 +- 当弹窗从左侧或右侧弹出时,默认不设置宽度和高度,弹窗的宽高取决于内容的宽高。 ```html - + + + + + + + + + + + ``` ### 关闭图标 diff --git a/packages/vant/src/popup/demo/index.vue b/packages/vant/src/popup/demo/index.vue index 3de32134a..d8b30b4d4 100644 --- a/packages/vant/src/popup/demo/index.vue +++ b/packages/vant/src/popup/demo/index.vue @@ -1,6 +1,8 @@