Skip to content
Snippets Groups Projects
Commit 7e554590 authored by Adam Procter's avatar Adam Procter
Browse files

adding drag

parent faa1a458
No related branches found
No related tags found
No related merge requests found
<template> <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"> <g class="draggable-group" v-for="(nodes, index) in myArray" :key="index">
<rect width="150" height="200" style="fill: rgb(255, 0, 100)" /> <rect width="150" height="200" style="fill: rgb(255, 0, 100)" />
<foreignObject id="x" x="10" width="131" height="100"> <foreignObject id="x" x="10" width="131" height="100">
...@@ -77,7 +82,7 @@ export default { ...@@ -77,7 +82,7 @@ export default {
}, },
} }
// PLAIN JS should be a mixin // THIS IS PLAIN JS should be a mixin
function makeDraggable(svg) { function makeDraggable(svg) {
// var svg = evt.target // var svg = evt.target
...@@ -142,9 +147,9 @@ function makeDraggable(svg) { ...@@ -142,9 +147,9 @@ function makeDraggable(svg) {
</script> </script>
<style scoped> <style scoped>
.draggable,
.draggable-group { .draggable-group {
cursor: move; cursor: move;
max-width: 150px;
} }
.static { .static {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment