May 07, 2021 Vant
import Vue from 'vue';
import { Divider } from 'vant';
Vue.use(Divider);
A horizontal split line is rendered by default
<van-divider />
Insert content through the slot in the middle of the split line
<van-divider>文字</van-divider>
Specify where the content is located bycontent-position
<van-divider content-position="left">文字</van-divider>
<van-divider content-position="right">文字</van-divider>
Add a dashed property to render the split line as a dashed line
<van-divider dashed>文字</van-divider>
You can style split lines directly from the style properties
<van-divider :style="{ color: '#1989fa', borderColor: '#1989fa', padding: '0 16px' }">
文字
</van-divider>
Parameters | Description | Type | The default |
---|---|---|---|
dashed | Whether to use dashed lines | boolean |
false
|
hairline | Whether to use the 0.5px line | boolean |
true
|
content-position |
Content location, optional value
left
right
|
string |
center
|
Name | Description |
---|---|
default | Content |