mauricius / vue-draggable-resizable

Vue3 Component for draggable and resizable elements.
https://mauricius.github.io/vue-draggable-resizable/
MIT License
3.33k stars 559 forks source link

Multiple addition of elements to 1 parent #404

Open hk3dva opened 8 months ago

hk3dva commented 8 months ago

I doubt that this is implemented, but I would like to know if there is any possibility to add 2 or more vue-draggable-resizables and make them have 1 common parent as a constraint. I tried to naively implement a simple addition, but it turns out that each subsequent element is a child of the previous one.

<template>
    <Story auto-props-disabled title="Basic use case">
        <div style="position: relative; height: 400px; border: 1px solid blue; margin: 1em;">

          <vue-draggable-resizable :parent="true">
            <p>321</p>
          </vue-draggable-resizable>

          <vue-draggable-resizable :parent="true">
            <p>123</p>
          </vue-draggable-resizable>

        </div>

        <template #controls>
        <HstCheckbox v-model="parent" title="Costrained in parent" />
      </template>
    </Story>
    <Block />
  </template>

In this example, I want to <div style="position: relative; height: 400px; border: 1px solid blue; margin: 1em;"> was a parent for everyone vue-draggable-resizable.

TackJordy commented 4 months ago

I'm having the same problem, anyone that solved this?