form.js 589 Bytes
export default {
  methods: {
    validate(callback) {
      if (this.$refs.form) {
        return this.$refs.form.validate(callback);
      }
      return false;
    },
    validateField(props, callback) {
      if (this.$refs.form) {
        return this.$refs.form.validateField(props, callback);
      }
      return false;
    },
    resetFields() {
      if (this.$refs.form) {
        this.$refs.form.resetFields();
      }
    },
    clearValidate(props) {
      if (this.$refs.form) {
        return this.$refs.form.clearValidate(props);
      }
      return false;
    },
  },
};