跳转至

表单重置不生效

重置的内容必须添加 prop

this.$refs.setForm.resetFields();
<a-form-model-item label="Activity zone" prop="region">
  <a-select v-model="form.region" placeholder="please select your zone">
    <a-select-option value="shanghai">
      Zone one
    </a-select-option>
    <a-select-option value="beijing">
      Zone two
    </a-select-option>
  </a-select>
</a-form-model-item>

添加星标不校验

  1. 新增 required
  2. 不添加 rule 校验
<a-form-model-item label="Activity zone" prop="region" required>
  <a-select v-model="form.region" placeholder="please select your zone">
    <a-select-option value="shanghai">
      Zone one
    </a-select-option>
    <a-select-option value="beijing">
      Zone two
    </a-select-option>
  </a-select>
</a-form-model-item>

参考

  • 官方文档:https://1x.antdv.com/components/form-model-cn