Skip to content

Commit

Permalink
fix: not update color of todo when change view mode #361
Browse files Browse the repository at this point in the history
  • Loading branch information
todrfu committed Aug 28, 2020
1 parent 455cf0b commit 926d781
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion calendar/index.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
bind:whenChangeWeek="whenChangeWeek"
bind:whenChangeMonth="whenChangeMonth"
bind:afterCalendarRender="afterCalendarRender"
></calendar>
/>
```

其中自定义事件功能对应如下,返回参数的具体格式可运行 `calendarComponent` 页面查看
Expand Down Expand Up @@ -206,14 +206,20 @@ Page({
- (1) 调用当前页面实例上的方法(方法均已挂载至小程序页面实例的 `calendar` 对象上)

```js
/**
* 获取当前页面实例的方法
* 1. 原生小程序开发,Page() 入参对象上的函数,this直接指向当前页面实例
* 2. Taro3.0.5及以上版本中可使用 getCurrentInstance() 获取当前页面实例
* 3. 通用方法则直接调用小程序函数 getCurrentPages(),取数组最后一个即为当前页面实例
**/
Page({
doSometing() {
this.calendar.jump(2018, 6, 6);
}
})
```

- (2) 手动引入方法
- (2) 手动引入

```js
import { jump } from '../../component/calendar/main.js';
Expand Down Expand Up @@ -391,8 +397,6 @@ const dates = this.calendar.getCalendarDates(options);

`switchView('week')`,默认值为'month';

> `switchView()` 返回 `Promise`
> 因周视图模式特殊性,该模式下会隐藏年月切换操作栏
```js
Expand Down
1 change: 1 addition & 0 deletions src/component/calendar/func/week.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ class WeekMode extends WxData {
}
const todo = todoLabels[idx] || {};
if (date.showTodoLabel && todo.todoText) date.todoText = todo.todoText;
if (todo.color) date.color = todo.color;
}
return date;
}
Expand Down

0 comments on commit 926d781

Please sign in to comment.