深度画布联调
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<fullscreen-dialog v-model="dialogVisible" hide-destroy>
|
||||
<div class="canvas-box">
|
||||
<depth-canvas :config="config" @close="close" />
|
||||
<depth-canvas :config="config" @workbench="onWorkbench" @close="onClose" />
|
||||
</div>
|
||||
</fullscreen-dialog>
|
||||
</template>
|
||||
@@ -12,23 +12,25 @@
|
||||
import { ref } from 'vue'
|
||||
const dialogVisible = ref(false)
|
||||
const config = ref({
|
||||
width: 750,
|
||||
height: 600,
|
||||
id: '',
|
||||
url: ''
|
||||
})
|
||||
|
||||
const open = (options) => {
|
||||
config.value = options
|
||||
dialogVisible.value = true
|
||||
// config.value = options || {}
|
||||
const defaultConfig = {
|
||||
canvasWidth: 750,
|
||||
canvasHeight: 600,
|
||||
canvasViewWidth: 750,
|
||||
canvasViewHeight: 600,
|
||||
}
|
||||
config.value = { ...defaultConfig, ...options || {} }
|
||||
}
|
||||
const close = () => {
|
||||
// 工作区
|
||||
const onWorkbench = (options) => {
|
||||
dialogVisible.value = false
|
||||
config.value.onWorkbench?.(options)
|
||||
}
|
||||
// 关闭
|
||||
const onClose = () => {
|
||||
dialogVisible.value = false
|
||||
config.value.onClose?.()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
close
|
||||
|
||||
Reference in New Issue
Block a user