feat: Add moveable to ResizeRotateNode.vue

This commit is contained in:
Braks
2022-05-22 22:46:47 +02:00
parent 0e00a41d44
commit b120c22174
2 changed files with 25 additions and 4 deletions
+2 -2
View File
@@ -27,8 +27,8 @@ const onLoad = (flowInstance: FlowInstance) => {
</template>
<style>
@import '../node_modules/@braks/vue-flow/dist/style.css';
@import '../node_modules/@braks/vue-flow/dist/theme-default.css';
@import '@braks/vue-flow/dist/style.css';
@import '@braks/vue-flow/dist/theme-default.css';
html,
body,
@@ -1,3 +1,24 @@
<script lang="ts" setup></script>
<script lang="ts" setup>
import type { MoveableEvents } from 'vue3-moveable'
import Moveable from 'vue3-moveable'
import type { Dimensions } from '@braks/vue-flow'
<template></template>
const props = defineProps<{
id: string
label: string
dimensions: Dimensions
}>()
const el = ref()
const onScale = ({ scale, transform, target }: MoveableEvents['scale']) => {}
const onRotate = () => {}
</script>
<template>
<div ref="el" class="vue-flow__node-default">
{{ label }}
</div>
<Moveable :target="[`[data-id='${id}']`]" :scalable="true" :rotatable="true" @scale="onScale" @rotate="onRotate" />
</template>