<template>
  <div>
    <richform ref="richform" :form="form" :setData="setData" @submit="search" @mounted="$emit('mounted')" />
    <slot></slot>
  </div>
</template>
<script>
export default {
  props: {
    form: {
      required: true,
      type: Array
    },
    setData: null
  },
  methods: {
    search(formData) {
      this.$emit('search', formData)
    },
    getSubmitData() {
      return this.$refs.richform.getSubmitData()
    },
    initForm() {
      this.$refs.richform.initForm()
    },
    reset() {
      this.$refs.richform.reset()
    }
  }
}
</script>