File tree Expand file tree Collapse file tree
lib/form-helper/src/vanilla Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ export class FormHelper {
1313 throwError : true ,
1414 } ;
1515
16+ declare [ 'constructor' ] : typeof FormHelper ;
17+
1618 /**
1719 * 选项。 Options.
1820 */
@@ -29,12 +31,13 @@ export class FormHelper {
2931 protected _cachedFields : Map < string , Cash > ;
3032
3133 constructor ( selector : Selector , options ?: FormHelperOptions ) {
34+ const { DEFAULT , globalControls} = this . constructor ;
3235 this . _options = {
33- ...FormHelper . DEFAULT ,
36+ ...DEFAULT ,
3437 ...options ,
3538 controls : {
36- ...FormHelper . globalControls ,
37- ...FormHelper . DEFAULT . controls ,
39+ ...globalControls ,
40+ ...DEFAULT . controls ,
3841 ...options ?. controls ,
3942 } ,
4043 } ;
@@ -188,7 +191,7 @@ export class FormHelper {
188191 } ;
189192
190193 static registerControl ( type : string , finder : FormControlFinder ) {
191- FormHelper . globalControls [ type ] = finder ;
194+ this . globalControls [ type ] = finder ;
192195 }
193196}
194197
You can’t perform that action at this time.
0 commit comments