提交表单按钮未触发

submit form button is not firing

我有一个 devextreme 表单,上面有一些字段和一个提交按钮。如果我点击提交按钮,组件中相应的点击事件不会触发。 useSubmitBehavior 设置为 true,submit 事件设置为组件点击事件。这是一个简单的例子:example

您必须将 <dx-form> 标签放入 <form> 并将 (submit)="formSubmit()" 移至 <form> 标签

<form (submit)="formSubmit()">
  <dx-form>
    <dxi-item dataField="name">
      <dxi-validation-rule type="async" message="name already exists" 
       [validationCallback]="alreadyExists">
      </dxi-validation-rule>
    </dxi-item>
    <dxi-item>
      <dx-button text="submit" [useSubmitBehavior]="true"></dx-button>
      <dx-button text="close" (click)="closeButtonClick()"></dx-button>
    </dxi-item>
  </dx-form>
</form>