<script setup lang="ts">
import { provide, inject } from 'vue'
import { reactive } from 'vue'
import type { IWidgetJson } from '@/types/widgetsConfigInterface'
import RendererDom from '@/components/RendererDom.vue'

// 文书结构
const widgetJson = inject<IWidgetJson>('widgetJson')!

// 文书表单
const docForm = reactive({})
provide('docForm', docForm)
</script>

<template>
  <section>
    <h1 class="text-sky-300">{{ widgetJson }}</h1>
    <el-form :model="docForm" label-width="80px">
      <template v-for="item in widgetJson['widgetList']" :key="item['id']">
        <RendererDom :itemData="item" />
      </template>
    </el-form>
  </section>
</template>
