From 7e5545902f36bacdc10622cd390b7e869d9d774c Mon Sep 17 00:00:00 2001 From: Adam Procter <adamprocter@researchnot.es> Date: Tue, 28 Dec 2021 13:10:33 +0000 Subject: [PATCH] adding drag --- src/components/SpaceBase.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/SpaceBase.vue b/src/components/SpaceBase.vue index 2304952..50f2af3 100644 --- a/src/components/SpaceBase.vue +++ b/src/components/SpaceBase.vue @@ -1,5 +1,10 @@ <template> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 10000" ref="myref"> + <svg + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 1000 1000" + width="450px" + ref="myref" + > <g class="draggable-group" v-for="(nodes, index) in myArray" :key="index"> <rect width="150" height="200" style="fill: rgb(255, 0, 100)" /> <foreignObject id="x" x="10" width="131" height="100"> @@ -77,7 +82,7 @@ export default { }, } -// PLAIN JS should be a mixin +// THIS IS PLAIN JS should be a mixin function makeDraggable(svg) { // var svg = evt.target @@ -142,9 +147,9 @@ function makeDraggable(svg) { </script> <style scoped> -.draggable, .draggable-group { cursor: move; + max-width: 150px; } .static { -- GitLab