From 9dfa701454d6a94690bad39dbb0e38f2a0b31489 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期二, 18 六月 2024 18:08:47 +0800
Subject: [PATCH] build

---
 src/hooks/web/useSortable.ts |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/hooks/web/useSortable.ts b/src/hooks/web/useSortable.ts
index 4c66b6a..ab7da70 100644
--- a/src/hooks/web/useSortable.ts
+++ b/src/hooks/web/useSortable.ts
@@ -2,14 +2,16 @@
 import type { Ref } from 'vue';
 import type { Options } from 'sortablejs';
 
-export function useSortable(el: HTMLElement | Ref<HTMLElement>, options?: Options) {
+export function useSortable(el?: HTMLElement | Ref<HTMLElement | undefined>, options?: Options) {
   function initSortable() {
     nextTick(async () => {
+      el = unref(el);
+
       if (!el) return;
 
       const Sortable = (await import('sortablejs')).default;
-      Sortable.create(unref(el), {
-        animation: 500,
+      Sortable.create(el, {
+        animation: 100,
         delay: 400,
         delayOnTouchOnly: true,
         ...options,

--
Gitblit v1.9.3