Skip to content

Commit

Permalink
fix: fix component v-model error when list is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred-Skyblue committed Mar 26, 2024
1 parent d6fa90e commit d055212
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-draggable-plus",
"version": "0.3.5",
"version": "0.4.0",
"author": {
"name": "yangpanteng",
"email": "[email protected]"
Expand Down
7 changes: 2 additions & 5 deletions src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const VueDraggable = defineComponent<IProps>({
}, {} as any)

const options = computed(() => {
// eslint-disable-next-line
// eslint-disable-next-line
const { modelValue, ...rest } = toRefs(props)
const opt = Object.entries(rest).reduce((acc, [key, value]) => {
// @ts-ignore
Expand All @@ -119,9 +119,6 @@ export const VueDraggable = defineComponent<IProps>({

expose(data)

return () => {
if (slots.default)
return h(props.tag || 'div', { ref: target }, slots.default(data))
}
return () => h(props.tag || 'div', { ref: target }, slots?.default?.(data))
}
})

0 comments on commit d055212

Please sign in to comment.