forked from opentiny/tiny-vue
22 lines
580 B
Vue
22 lines
580 B
Vue
<template>
|
||
<div>
|
||
<tiny-process-designer :height="480" @element.click="onElementClick" @selection.changed="onSelectionChanged" />
|
||
<p>当前选中:{{ selectedId || '无' }}</p>
|
||
</div>
|
||
</template>
|
||
|
||
<script setup>
|
||
import { ref } from 'vue'
|
||
import { TinyProcessDesigner } from '@opentiny/vue'
|
||
|
||
const selectedId = ref('')
|
||
|
||
const onElementClick = (event) => {
|
||
selectedId.value = event && event.element ? event.element.id : ''
|
||
}
|
||
|
||
const onSelectionChanged = ({ newSelection }) => {
|
||
selectedId.value = newSelection && newSelection[0] ? newSelection[0].id : ''
|
||
}
|
||
</script>
|