<template>
  <div style="display: flex;height: 100% ; width: 100%">
    <div style="height: 100% ; width: 50%" ref="divRef1">
    </div>
    <div style="height: 100% ; width: 50%" ref="divRef2">
    </div>
  </div>
</template>

<script setup lang="ts">
import {onMounted, ref} from "vue";
import {
  useEmrInit
} from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init-v2";

const divRef1 = ref<HTMLDivElement>(null)
const divRef2 = ref<HTMLDivElement>(null)

const event = {
  'ready': (val) => {
    console.log(val)
  }
}

const appContext = ref({
  a: 12312,
  b: 2323
})

onMounted(() => {
  useEmrInit(divRef1.value, {appContext: appContext.value}).then(res => {
    res.editor.on('loaded', () => {
      console.log(1232)
    })

    console.log(res.editor.getDocument());
  })

  useEmrInit(divRef2.value)

})

</script>
