From 9a49963a918beefac7b8ad7163be95434f88dea9 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Sun, 27 Jul 2025 22:27:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0cl-draggable=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.uvue | 1 + components/tabbar.uvue | 2 + cool/theme/index.ts | 3 +- package.json | 2 +- pages.json | 6 + pages/demo/data/draggable.uvue | 178 +++++ pages/index/home.uvue | 5 + .../components/cl-draggable/cl-draggable.uvue | 673 ++++++++++++++++++ .../cool-ui/components/cl-draggable/props.ts | 15 + uni_modules/cool-ui/index.d.ts | 2 + 10 files changed, 885 insertions(+), 2 deletions(-) create mode 100644 pages/demo/data/draggable.uvue create mode 100644 uni_modules/cool-ui/components/cl-draggable/cl-draggable.uvue create mode 100644 uni_modules/cool-ui/components/cl-draggable/props.ts diff --git a/App.uvue b/App.uvue index 5537236..4fbd438 100644 --- a/App.uvue +++ b/App.uvue @@ -3,6 +3,7 @@ import { useStore } from "@/cool"; // #ifdef H5 import TouchEmulator from "hammer-touchemulator"; +// 模拟移动端调试的触摸事件 TouchEmulator(); // #endif diff --git a/components/tabbar.uvue b/components/tabbar.uvue index 013e70b..d726339 100644 --- a/components/tabbar.uvue +++ b/components/tabbar.uvue @@ -61,7 +61,9 @@ const list = computed(() => { }); // 隐藏原生 tabBar +// #ifndef MP uni.hideTabBar(); +// #endif diff --git a/uni_modules/cool-ui/components/cl-draggable/props.ts b/uni_modules/cool-ui/components/cl-draggable/props.ts new file mode 100644 index 0000000..ab5251e --- /dev/null +++ b/uni_modules/cool-ui/components/cl-draggable/props.ts @@ -0,0 +1,15 @@ +import type { PassThroughProps } from "../../types"; + +export type ClDraggablePassThrough = { + className?: string; + ghost?: PassThroughProps; +}; + +export type ClDraggableProps = { + className?: string; + pt?: ClDraggablePassThrough; + modelValue?: UTSJSONObject[]; + disabled?: boolean; + animation?: number; + columns?: number; +}; diff --git a/uni_modules/cool-ui/index.d.ts b/uni_modules/cool-ui/index.d.ts index 927e135..44835e4 100644 --- a/uni_modules/cool-ui/index.d.ts +++ b/uni_modules/cool-ui/index.d.ts @@ -12,6 +12,7 @@ import type { ClCheckboxProps, ClCheckboxPassThrough } from "./components/cl-che import type { ClColProps, ClColPassThrough } from "./components/cl-col/props"; import type { ClCollapseProps, ClCollapsePassThrough } from "./components/cl-collapse/props"; import type { ClCountdownProps, ClCountdownPassThrough } from "./components/cl-countdown/props"; +import type { ClDraggableProps, ClDraggablePassThrough } from "./components/cl-draggable/props"; import type { ClFloatViewProps } from "./components/cl-float-view/props"; import type { ClFooterProps, ClFooterPassThrough } from "./components/cl-footer/props"; import type { ClIconProps, ClIconPassThrough } from "./components/cl-icon/props"; @@ -77,6 +78,7 @@ declare module "vue" { "cl-col": (typeof import('./components/cl-col/cl-col.uvue')['default']) & import('vue').DefineComponent; "cl-collapse": (typeof import('./components/cl-collapse/cl-collapse.uvue')['default']) & import('vue').DefineComponent; "cl-countdown": (typeof import('./components/cl-countdown/cl-countdown.uvue')['default']) & import('vue').DefineComponent; + "cl-draggable": (typeof import('./components/cl-draggable/cl-draggable.uvue')['default']) & import('vue').DefineComponent; "cl-float-view": (typeof import('./components/cl-float-view/cl-float-view.uvue')['default']) & import('vue').DefineComponent; "cl-footer": (typeof import('./components/cl-footer/cl-footer.uvue')['default']) & import('vue').DefineComponent; "cl-icon": (typeof import('./components/cl-icon/cl-icon.uvue')['default']) & import('vue').DefineComponent;