Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
添加 datepicker/timepicker 组件文档
Browse files Browse the repository at this point in the history
  • Loading branch information
xxapp committed Jun 15, 2017
1 parent 9735ba1 commit 178400e
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 8 deletions.
57 changes: 57 additions & 0 deletions components/ms-datepicker/ms-datepicker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## 日期选择器

### 基本用法

```html
<div :controller="test">
<ms-datepicker :widget="{
placeholder:'请选择入学时间'
}"></ms-datepicker>
</div>
```

### 格式化日期

```html
<div :controller="test">
<ms-datepicker :widget="{
placeholder:'请选择入学时间',
format:'YYYY/MM/DD'
}"></ms-datepicker>
</div>
```

### 不可选择的日期

```html
<div :controller="test">
<ms-datepicker :widget="{
placeholder:'请选择入学时间',
startDate:'2017/5/26',
endDate:'2018/7/26'
}"></ms-datepicker>
</div>
```

### 日期时间选择

```html
<div :controller="test">
<ms-datepicker :widget="{
placeholder:'请选择抢购开始时间',
showTime: true
}"></ms-datepicker>
</div>
```

### 组件参数

| 参数 | 说明 | 类型 | 默认值 |
|-----|-----|-----|-----|
| format | 日期格式,参考 momentjs | string | `'YYYY-MM-DD'` |
| startDate | 控制可以选择的日期范围的开始日期 | string | '' |
| endDate | 控制可以选择的日期范围的结束日期 | string | '' |
| disabledDate | 不可选择日期的判断函数,传入 current(当前遍历日期的毫秒值),返回 true 表示此日期不可选 | function(current:number) | `() => false` |
| showTime | 是否需要选择时间,如果此项为 true,则 format 默认为 YYYY-MM-DD HH:mm:ss | boolean | false |

> 继承 [ms-control 组件](#!/form-control) 的所有参数
30 changes: 30 additions & 0 deletions components/ms-timepicker/ms-timepicker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## 时间选择器

### 基本用法

```html
<div :controller="test">
<ms-timepicker :widget="{
placeholder:'请选择打卡时间'
}"></ms-timepicker>
</div>
```

### 格式化时间

```html
<div :controller="test">
<ms-timepicker :widget="{
placeholder:'请选择打卡时间',
format:'HH:mm'
}"></ms-timepicker>
</div>
```

### 组件参数

| 参数 | 说明 | 类型 | 默认值 |
|-----|-----|-----|-----|
| format | 日期格式,参考 momentjs | string | `'HH:mm:ss'` |

> 继承 [ms-control 组件](#!/form-control) 的所有参数
26 changes: 18 additions & 8 deletions docs/nav.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,52 @@ module.exports = [{
title: '组件',
children: [{
key: 'component-demo-input-input',
title: '输入框',
title: 'input 输入框',
uri: '/input',
location: 'ms-input/ms-input.md'
}, {
key: 'component-demo-textarea-textarea',
title: '多行输入框',
title: 'textarea 多行输入框',
uri: '/textarea',
location: 'ms-textarea/ms-textarea.md'
}, {
key: 'component-demo-select-select',
title: '选择框',
title: 'select 选择框',
uri: '/select',
location: 'ms-select/ms-select.md'
}, {
key: 'component-demo-datepicker-datepicker',
title: 'datepicker 日期选择器',
uri: '/datepicker',
location: 'ms-datepicker/ms-datepicker.md'
}, {
key: 'component-demo-timepicker-timepicker',
title: 'timepicker 时间选择器',
uri: '/timepicker',
location: 'ms-timepicker/ms-timepicker.md'
}, {
key: 'component-demo-form-control',
title: '表单控件',
title: 'form-control 表单控件',
uri: '/form-control',
location: 'ms-form/ms-control.md'
}, {
key: 'component-demo-form-form',
title: '表单',
title: 'form 表单',
uri: '/form',
location: 'ms-form/ms-form.md'
}, {
key: 'component-demo-menu-menu',
title: '菜单',
title: 'menu 菜单',
uri: '/menu',
location: 'ms-menu/ms-menu.md'
}, {
key: 'component-demo-table-table',
title: '数据表格',
title: 'table 数据表格',
uri: '/table',
location: 'ms-table/ms-table.md'
}, {
key: 'component-demo-dialog-dialog',
title: '对话框',
title: 'dialog 对话框',
uri: '/dialog',
location: 'ms-dialog/ms-dialog.md'
}]
Expand Down

0 comments on commit 178400e

Please sign in to comment.