allow to drag new fields into page

This commit is contained in:
Alex Turchyn
2023-05-23 00:03:26 +03:00
parent 97c462ead2
commit 91b955a39f
5 changed files with 82 additions and 9 deletions
+8 -1
View File
@@ -5,8 +5,10 @@
:number="index"
:areas="areasIndex[index]"
:is-draw="isDraw"
:is-drag="isDrag"
:class="{ 'cursor-crosshair': isDraw }"
:image="image"
@drop-field="$emit('drop-field', {...$event, attachment_uuid: document.uuid })"
@draw="$emit('draw', {...$event, attachment_uuid: document.uuid })"
/>
</template>
@@ -32,9 +34,14 @@ export default {
type: Boolean,
required: false,
default: false
},
isDrag: {
type: Boolean,
required: false,
default: false
}
},
emits: ['draw'],
emits: ['draw', 'drop-field'],
computed: {
sortedPreviewImages () {
return [...this.document.preview_images].sort((a, b) => parseInt(a.filename) - parseInt(b.filename))