// 重写表单验证
export default {
  install (Vue) {
    Vue.prototype.$formValidateFields = function (form) {
      var vm = this
      return new Promise(function (resolve) {
        vm[form].validateFieldsAndScroll((err, values) => {
          if (!err) {
            resolve(values)
          } else {
            // resolve(err)
            var e = new Error()
            e.err = err
            throw(e)
          }
        })
      })
    }
  }
}
