项目初始化
This commit is contained in:
		
							
								
								
									
										23
									
								
								src/app/shared/widget/editor/editor.widget.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								src/app/shared/widget/editor/editor.widget.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,23 @@ | ||||
| import { Component } from '@angular/core'; | ||||
| import { ControlWidget } from '@delon/form'; | ||||
|  | ||||
| @Component({ | ||||
|   selector: 'sf-editor', | ||||
|   template: ` | ||||
|     <sf-item-wrap [id]="id" [schema]="schema" [ui]="ui" [showError]="showError" [error]="error" [showTitle]="schema.title"> | ||||
|       <editor [ngModel]="value" name="sf.editor" (ngModelChange)="_change($event)"></editor> | ||||
|     </sf-item-wrap> | ||||
|   `, | ||||
|   preserveWhitespaces: false, | ||||
| }) | ||||
| // tslint:disable-next-line: component-class-suffix | ||||
| export class EditorWidget extends ControlWidget { | ||||
|   static readonly KEY = 'editor'; | ||||
|  | ||||
|   _change(value: string): void { | ||||
|     this.setValue(value); | ||||
|     if (this.ui.contentChanged) { | ||||
|       this.ui.contentChanged(value); | ||||
|     } | ||||
|   } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user