我有两个独立的拖动区域,当我将组件从一个区域拖动到另一个区域时,如何根据拖动到的区域动态更改组件的状态?
目前,我正在从序列化程序呈现状态,但我想在拖放后动态更改它。
<draggable
class="dragArea published"
:options="{ group: { name: 'g1', put: 'g1'}, animation: 120 }"
@end="onEnd">
<div
v-for="lesson in classroomLessonsPublished"
:class="`lesson-card ${lesson.id}`"
data-status="published">
<div>
{{ lesson.status }}
</div>
</div>
</draggable>
<draggable
class="dragArea unpublished"
:options="{ group: { name: 'g1', put: 'g1'}, animation: 120 }"
@end="onEnd">
<div
v-for="lesson in classroomLessonsUnpublished"
:class="`lesson-card ${lesson.id}`"
data-status="unpublished">
<div>
{{ lesson.status }}
</div>
</div>
</draggable>