asda
创建一个组件:
$ ionic g component CustomCalender
import { CalendarComponent } from ‘./custom-calender/custom-calender’;
@NgModule({ CalendarComponent })
exports: [CalendarComponent]
在需要引用的 html 中 使用:
在需要引用的 ts 中:
export class SignPage {
selected:number[] = [1,2,3,5,7];
today:Date = new Date();
curDay = this.today.getDate(); //今天
}
在签到响应事件中 传入需要 签到的日期:
this.selected.push(this.curDay);