Open Cruxial0 opened 2 months ago
It is recommended to use components or composition functions instead of directives for dynamic lists.
Using the component approach has an issue with nesting. When I try to set the target
variable, I get another error:
I assume this is because it looks for the selector of my items before any are generated. Data gets passed into my component using a command after creation. I can't find a way to circumvent this issue without using static data. Any ideas?
<VueDraggable v-model="lineCollection" group="lines" :animation="150" ghostClass="ghost" @onUpdate="onUpdate" target=".merge-item-container">
<div id="lines" class="merge-editor-line" v-for="line in lineCollection">
<MergePatternItem v-for="item in line" :key="item.id" :name="item.name" :kind="item.kind"/>
</div>
</VueDraggable>
In the code above, the .merge-item-container
selector is used for the root container in MergePatternItem
Hi, I am in the process of creating a program that needs to procedurally generate draggable lines.
I am using a similar approach to what's discussed in #1, but dragging onto other lines don't do anything, and reordering elements within the same line results in an error:
Here is a simplified version of my application: