import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'cm-select-doc-1', templateUrl: './select-doc-1.component.html', styleUrls: ['./select-doc-1.component.css'] }) export class SelectDoc1Component implements OnInit { options:any = []; selectedOption:string; ngOnInit() { // 模拟服务器异步加载 setTimeout(_ => { this.options = [{ value: 'jack', label: 'Jack' }, { value: 'lucy', label: 'Lucy' }, { value: 'disabled', label: 'Disabled', disabled: true }]; this.selectedOption = this.options[0]; }, 100); } constructor() {} }