message: feat(Form): add validate-first prop
diff: @@ -3,6 +3,10 @@ import { createNamespace } from '../utils';
  const [createComponent, bem] = createNamespace('form');
  export default createComponent({
  + props: {
  + validateFirst: Boolean,
  + },
  +
  provide() {
  return {
  vanForm: this,
  @@ -16,8 +20,35 @@ export default createComponent({
  },
  methods: {
  - // @exposed-api
  - validate() {
  + validateSeq() {
  + return new Promise((resolve, reject) => {
  + const errors = [];
  +
  + this.fields
  + .reduce(
  + (promise, field) =>
  + promise.then(() => {
  + if (!errors.length) {
  + return field.validate().then(error => {
  + if (error) {
  + errors.push(error);
  + }
  + });
  + }
  + }),
  + Promise.resolve()
  + )
  + .then(() => {
  + if (errors.length) {
  + reject(errors);
  + } else {
  + resolve();
  + }
  + });
  + });
  + },
  +
  + validateAll() {
  return new Promise((resolve, reject) => {
  Promise.all(this.fields.map(item => item.validate())).then(errors => {
  errors = errors.filter(item => item);
  @@ -31,6 +62,11 @@ export default createComponent({
  });
  },
  + // @exposed-api
  + validate() {
  + return this.validateFirst ? this.validateSeq() : this.validateAll();
  + },
  +
  getValues() {
  return this.fields.reduce((form, field) => {
  form[field.name] = field.formValue;
  