From 1c02253ce522dbe8c73a0512dd1d70e980d9dd42 Mon Sep 17 00:00:00 2001 From: Nick Gamroth Date: Fri, 27 Nov 2020 09:14:07 -0600 Subject: [PATCH 1/2] Added emits option to prevent warnings --- src/vuedraggable.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vuedraggable.js b/src/vuedraggable.js index 7e11c4c..1371862 100644 --- a/src/vuedraggable.js +++ b/src/vuedraggable.js @@ -67,6 +67,8 @@ const props = { } }; +const emits = ["change", "start", "add", "remove", "update", "end", "choose", "unchoose", "sort", "filter", "clone"]; + const draggableComponent = defineComponent({ name: "draggable", @@ -74,6 +76,8 @@ const draggableComponent = defineComponent({ props, + emits, + data() { return { error: false From f93e2858a88ce865445c6c2fe17380348a035dbf Mon Sep 17 00:00:00 2001 From: David Date: Mon, 30 Nov 2020 13:50:06 -0300 Subject: [PATCH 2/2] Improve event definition --- src/vuedraggable.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vuedraggable.js b/src/vuedraggable.js index 1371862..90c0fea 100644 --- a/src/vuedraggable.js +++ b/src/vuedraggable.js @@ -7,6 +7,7 @@ import { getValidSortableEntries } from "./core/componentBuilderHelper"; import { computeComponentStructure } from "./core/renderHelper"; +import { events } from "./core/sortableEvents"; import { h, defineComponent, nextTick } from "vue"; function emit(evtName, evtData) { @@ -67,7 +68,11 @@ const props = { } }; -const emits = ["change", "start", "add", "remove", "update", "end", "choose", "unchoose", "sort", "filter", "clone"]; +const emits = [ + "update:modelValue", + "change", + ...[...events.manageAndEmit, ...events.emit].map(evt => evt.toLowerCase()) +]; const draggableComponent = defineComponent({ name: "draggable",