Web Demo Mobile Demo Angular Demo Vue Demo React Demo
源代码
import { Component } from '@angular/core';

@Component({
	selector: 'app-root',
	template: `
		<h2>Date Template</h2>
		<eui-calendar [(selection)]="value" style="width:250px;height:250px">
			<ng-template euiCellTemplate let-date>
				<span [class.sdc]="isSpecialDate(date)">{{date.getDate()}}</span>
			</ng-template>
		</eui-calendar>
		<p>{{value}}</p>
	`,
	styles: [`
		.sdc{
			background: red;
			color: #fff;
			padding: 5px;
			border-radius: 50%;
		}
	`]
})
export class AppComponent {
	value = new Date();
	isSpecialDate(date) {
		let day = date.getDate();
		if (day == 10 || day == 20 || day == 30){
			return true;
		} else {
			return false;
		}
	}
}
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { EasyUIModule } from 'easyui/easyui/easyui.module';


import { AppComponent }   from './app.component';

@NgModule({
  bootstrap: [
    AppComponent
  ],
  declarations: [
    AppComponent
  ],
  imports: [
    FormsModule,
    BrowserModule,
    HttpModule,
    EasyUIModule
  ]
})
export class AppModule { }

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';

enableProdMode();

platformBrowserDynamic().bootstrapModule(AppModule);