From 439e3b0f076280311b7cd4251a95820730242780 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 07 八月 2024 10:43:33 +0800 Subject: [PATCH] 一些更新 --- 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