[new feature] add divider component (#3755)

This commit is contained in:
neverland
2019-07-04 20:51:43 +08:00
committed by GitHub
parent 6d67f4572c
commit aac691b7eb
12 changed files with 380 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
# Divider
### Install
``` javascript
import { Divider } from 'vant';
Vue.use(Divider);
```
## Usage
### Basic Usage
```html
<van-divider />
```
### With Text
```html
<van-divider>Text</van-divider>
```
### Content Position
```html
<van-divider content-position="left">Text</van-divider>
<van-divider content-position="right">Text</van-divider>
```
### Dashed
```html
<van-divider dashed>Text</van-divider>
```
### Custom Style
```html
<van-divider :style="{ color: '#1989fa', borderColor: '#1989fa', padding: '0 15px' }">
Text
</van-divider>
```
## API
### Props
| Attribute | Description | Type | Default |
|------|------|------|------|
| dashed | Whether to use dashed border | `Boolean` | `false` |
| hairline | Whether to use hairline | `Boolean` | `true` |
| content-position | Content positioncan be set to `left` `right` | `String` | `center` |
### Cell Slots
| Name | Description |
|------|------|
| default | content |