Skip to content

Commit

Permalink
Merge pull request #90 from treadpit/develop
Browse files Browse the repository at this point in the history
update readme
  • Loading branch information
todrfu authored Mar 13, 2019
2 parents c2da99c + 84d5f39 commit 17ee700
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### 思路分析

要实现一个简单的日历,需要先知道几个值:
要实现一个简单的小程序日历,需要先知道几个值:

- 每月有多少天

Expand All @@ -20,23 +20,38 @@

> 每月最多31天,最少28天。
### 引入 wxml 及 wxss后初始化日历组件直接使用

### 引入组件

在页面 `json` 文件中配置组件

```json
{
"usingComponents": {
"calendar": "../../component/calendar/index"
}
}
```

在页面 `wxml` 中引入组件
```xml
<calendar calendar="{{calendar}}" gesture="{{gesture}}"></calendar>
```

### 初始化

```js
import initCalendar from '../../template/calendar/index';
import initCalendar from '../../component/calendar/main.js';
const conf = {
onShow() {
initCalendar(); // 使用默认配置初始化日历
onShow: function() {
initCalendar(); // 自定义配置 initCalendar({ multi: true, ... })
}
};
Page(conf);
```

更多配置及功能请 [参考文档](http://calendar.isfeer.com)
更多自定义配置及功能 [请查阅日历文档](http://calendar.isfeer.com)

### 日历模板效果图
### 效果图

![日历效果图](https://raw.githubusercontent.com/treadpit/wx_calendar/develop/screenshot/screenshot_calendar.gif)

### 日期选择器效果图

![日期选择器](https://raw.githubusercontent.com/treadpit/wx_calendar/develop/screenshot/screenshot_datepicker.gif)
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#### 1. 引入组件

在页面 `json` 文件中配置组件

```json
{
"usingComponents": {
Expand All @@ -20,6 +22,11 @@
}
```

在页面 `wxml` 中引入组件
```xml
<calendar calendar="{{calendar}}" gesture="{{gesture}}"></calendar>
```

#### 2. 日历组件初始化

```js
Expand Down

0 comments on commit 17ee700

Please sign in to comment.