Files
svgeditor2.0/src/views/preview/index_YPT.vue
2025-10-22 09:09:46 +08:00

20 lines
638 B
Vue

<template>
<mt-preview-ypt ref="MtPreviewRef" @on-event-call-back="onEventCallBack"></mt-preview-ypt>
</template>
<script setup lang="ts">
import { MtPreviewYpt } from '@/export'
import { onMounted, ref } from 'vue'
import { ElMessage } from 'element-plus'
const MtPreviewRef = ref<InstanceType<typeof MtPreviewYpt>>()
const onEventCallBack = (type: string, item_id: string) => {
console.log(type, item_id)
if (type == 'test-dialog') {
ElMessage.success(`获取到了id:${item_id}`)
}
}
onMounted(() => {
MtPreviewRef.value?.setImportJson(JSON.parse(sessionStorage.getItem('exportJson') as any))
})
</script>