doc(timeline)

This commit is contained in:
07akioni 2020-01-30 20:09:55 +08:00
parent 3f130451c2
commit 7fc112afd2
6 changed files with 133 additions and 3 deletions

View File

@ -0,0 +1,31 @@
# 基本用法
```html
<n-timeline>
<n-timeline-item
content="啊"
/>
<n-timeline-item
type="success"
title="成功"
content="哪里成功"
time="2018-04-03 20:46"
/>
<n-timeline-item
type="error"
content="哪里错误"
time="2018-04-03 20:46"
/>
<n-timeline-item
type="warning"
title="警告"
content="哪里警告"
time="2018-04-03 20:46"
/>
<n-timeline-item
type="info"
title="信息"
content="是的"
time="2018-04-03 20:46"
/>
</n-timeline>
```

View File

@ -0,0 +1,35 @@
# Timeline 时间线
这个世界有两个纬度:时间、事件。
## 例子
```demo
basic
size
item-placement
```
## Props
### Timeline Props
|名称|类型|默认值|介绍|
|-|-|-|-|
|item-placement|`'left' \| 'right'`|`'left'`||
|size|`'medium' \| 'large'`|`'medium'`||
### Timeline Item Props
|名称|类型|默认值|介绍|
|-|-|-|-|
|title|`string`|`null`||
|content|`string`|`null`||
|time|`string`|`null`||
|type|`'default' \| 'success' \| 'info' \| 'warning' \| 'error'`|`'default'`||
## Slots
### Timeline Slots
|名称|参数|介绍|
|-|-|-|
|default|`()`||
### Timeline Item Props
|名称|参数|介绍|
|-|-|-|
|default|`()`||
|header|`()`||
|footer|`()`||

View File

@ -0,0 +1,32 @@
# 方向
左,<span style="display: inline-block; transform: scaleX(-1);"></span>
```html
<n-timeline item-placement="right">
<n-timeline-item
content="啊"
/>
<n-timeline-item
type="success"
title="成功"
content="哪里成功"
time="2018-04-03 20:46"
/>
<n-timeline-item
type="error"
content="哪里失败"
time="2018-04-03 20:46"
/>
<n-timeline-item
type="warning"
title="警告"
content="哪里警告"
time="2018-04-03 20:46"
/>
<n-timeline-item
type="info"
title="信息"
content="是的"
time="2018-04-03 20:46"
/>
</n-timeline>
```

View File

@ -0,0 +1,32 @@
# 大小
`medium`、`large` 大小
```html
<n-timeline size="large">
<n-timeline-item
content="啊"
/>
<n-timeline-item
type="success"
title="成功"
content="哪里成功"
time="2018-04-03 20:46"
/>
<n-timeline-item
type="error"
content="哪里错误"
time="2018-04-03 20:46"
/>
<n-timeline-item
type="warning"
title="警告"
content="哪里警告"
time="2018-04-03 20:46"
/>
<n-timeline-item
type="info"
title="信息"
content="是的"
time="2018-04-03 20:46"
/>
</n-timeline>
```

View File

@ -23,7 +23,7 @@ export default {
validator (value) {
return ['left', 'right'].includes(value)
},
default: 'right'
default: 'left'
},
size: {
validator (value) {

View File

@ -45,7 +45,7 @@ $--timeline-header-margin-top: (
width: 100%;
display: flex;
flex-direction: column;
@include m(left-placement) {
@include m(right-placement) {
@include b(timeline-item) {
@include b(timeline-item-content) {
text-align: right;
@ -57,7 +57,7 @@ $--timeline-header-margin-top: (
}
}
}
@include m(right-placement) {
@include m(left-placement) {
@include b(timeline-item) {
@include b(timeline-item-content) {
margin-left: 26px;