fix(node-resizer): hide resizer when isVisible is false
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { VueFlow } from '@vue-flow/core'
|
import { VueFlow } from '@vue-flow/core'
|
||||||
import ResizableNode from './ResizableNode.vue'
|
import ResizableNode from './ResizableNode.vue'
|
||||||
|
import ResizableNodeSelected from './ResizableNodeSelected.vue'
|
||||||
|
|
||||||
const elements = ref([
|
const elements = ref([
|
||||||
{
|
{
|
||||||
@@ -39,5 +40,9 @@ const elements = ref([
|
|||||||
<template #node-resizable="resizableNodeProps">
|
<template #node-resizable="resizableNodeProps">
|
||||||
<ResizableNode :label="resizableNodeProps.label" />
|
<ResizableNode :label="resizableNodeProps.label" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template #node-resizableSelected="resizableNodeProps">
|
||||||
|
<ResizableNodeSelected :label="resizableNodeProps.label" :selected="resizableNodeProps.selected" />
|
||||||
|
</template>
|
||||||
</VueFlow>
|
</VueFlow>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { Handle, Position } from '@vue-flow/core'
|
||||||
|
import { NodeResizer } from '@vue-flow/node-resizer'
|
||||||
|
|
||||||
|
defineProps(['label', 'selected'])
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<NodeResizer color="#ff0071" :is-visible="selected" :min-width="100" :min-height="30" />
|
||||||
|
|
||||||
|
<Handle type="target" :position="Position.Left" />
|
||||||
|
<div style="padding: 10px">{{ label }}</div>
|
||||||
|
<Handle type="source" :position="Position.Right" />
|
||||||
|
</template>
|
||||||
@@ -28,6 +28,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<template v-if="isVisible">
|
||||||
<ResizeControl
|
<ResizeControl
|
||||||
v-for="c of lineControls"
|
v-for="c of lineControls"
|
||||||
:key="c"
|
:key="c"
|
||||||
@@ -67,3 +68,4 @@ export default {
|
|||||||
@resize-end="emits('resizeEnd', $event)"
|
@resize-end="emits('resizeEnd', $event)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user