Test.vue 867 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div style="display: flex;height: 100% ; width: 100%">
  3. <div style="height: 100% ; width: 50%" ref="divRef1">
  4. </div>
  5. <div style="height: 100% ; width: 50%" ref="divRef2">
  6. </div>
  7. </div>
  8. </template>
  9. <script setup lang="ts">
  10. import {onMounted, ref} from "vue";
  11. import {
  12. useEmrInit
  13. } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init-v2";
  14. const divRef1 = ref<HTMLDivElement>(null)
  15. const divRef2 = ref<HTMLDivElement>(null)
  16. const event = {
  17. 'ready': (val) => {
  18. console.log(val)
  19. }
  20. }
  21. const appContext = ref({
  22. a: 12312,
  23. b: 2323
  24. })
  25. onMounted(() => {
  26. useEmrInit(divRef1.value, {appContext: appContext.value}).then(res => {
  27. res.editor.on('loaded', () => {
  28. console.log(1232)
  29. })
  30. console.log(res.editor.getDocument());
  31. })
  32. useEmrInit(divRef2.value)
  33. })
  34. </script>