<template>
  <vFormRender :formCode="formCode" :dataId.sync="dataId"
               v-if="showEdit" visible-key="showEdit" :parent-target="_self"
               @reload="$reloadHandle"></vFormRender>
</template>
<script>

import vFormRender from "../../../../views/user/form/vform/render.vue";

export default {
  components: {vFormRender},
  data() {
    return {
      formCode: null,
      dataId: null,
      showEdit: false,
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      let formCode = this.$route.query.formCode || this.$attrs.formCode;
      let dataId = this.$route.query.dataId || this.$attrs.dataId || this.$attrs._dataId;

      if (dataId && formCode) {
        this.formCode = formCode;
        this.dataId = Number(dataId);
        this.showEdit = true;
      }
    }
  }
}
</script>
<style scoped>

</style>
