Skip to content

Commit

Permalink
fix: form
Browse files Browse the repository at this point in the history
  • Loading branch information
jc9702507 committed May 24, 2023
1 parent 664929b commit 25dbf24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Form/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ export class Form {
* @param formConfig 表单配置项
*/
constructor(formConfig:FormConfig = {}) {
const component2 = my.canIUse('component2');

Check warning on line 415 in src/Form/form.ts

View check run for this annotation

Codecov / codecov/patch

src/Form/form.ts#L415

Added line #L415 was not covered by tests
if (!component2) {
throw new Error('需要使用component2');

Check warning on line 417 in src/Form/form.ts

View check run for this annotation

Codecov / codecov/patch

src/Form/form.ts#L417

Added line #L417 was not covered by tests
}
this.setInitialValues(formConfig.initialValues || {});
this.setRules(formConfig.rules || {});
this.validateMessages = formConfig.validateMessages;
Expand Down

0 comments on commit 25dbf24

Please sign in to comment.