vant/docs/markdown/zh-CN/popup.md
neverland d8b6ad7d54
[new feature] add i18n support (#310)
* fix: Tabbar icon line-height

* [new feature] progress add showPivot prop

* [new feature] TabItem support vue-router

* [new feature] update document header style

* [Doc] add toast english ducoment

* [new feature] add i18n support

* feat: Extract demos from markdown

* feat: Base components demos

* [new feature] complete demo extract & translate

* [fix] text cases

* fix: add deepAssign test cases

* fix: changelog detail

* [new feature] AddressEdit support i18n
2017-11-15 20:08:51 -06:00

49 lines
1.1 KiB
Markdown

## Popup 弹出层
### 使用指南
``` javascript
import { Popup } from 'vant';
Vue.component(Popup.name, Popup);
```
### 代码演示
#### 基础用法
`popup`默认从中间弹出
```html
<van-popup v-model="show">内容</van-popup>
```
```javascript
export default {
data() {
return {
show: false
}
}
};
```
#### 弹出位置
通过`position`属性设置 Popup 弹出位置
```html
<van-popup v-model="show" position="top" :overlay="false">
内容
</van-popup>
```
### API
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|-----------|-----------|-----------|-------------|-------------|
| v-model | 当前组件是否显示 | `Boolean` | `false` | - |
| overlay | 是否显示背景遮罩层 | `Boolean` | `true` | - |
| lockOnScroll | 背景是否跟随滚动 | `Boolean` | `false` | - |
| position | 弹出层位置 | `String` | - | `top` `bottom` `right` `left` |
| closeOnClickOverlay | 点击遮罩层是否关闭弹出层 | `Boolean` | `true` | - |
| transition | 弹出层的`transition` | `String` | `popup-slide` | - |
| preventScroll | 是否防止滚动穿透 | `Boolean` | `false` | - |