<template>
  <div class="ps-form">
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: "PsForm",
  props: {
    model: {
      type: Object,
      default: () => {
        return {};
      },
    },
    rules: {
      type: Object,
      default: () => {
        return {};
      },
    },
    id: {
      type: String,
      default: null,
    },
  },
  data() {
    return {
      refs: null,
    };
  },
  created() {},
  mounted() {
    console.log(this.$children);
  },
  methods: {
    validate(func) {
      let error = false;
      let childRef = this.$children || [];
      childRef.forEach((el) => {
        el.validator();
        if (!error) {
          error = el.isError;
        }
      });
      func(error);
    },
  },
};
</script>

<style>
</style>
