fix:解决拖拽问题

This commit is contained in:
zhongyidian committed 2025-10-20 17:50:42 +08:00
1 parent ce06ad0214
commit 6367014e1f
34 files changed
+1712 -397

No files matched your search

+6 -6
View File
@@ -1,14 +1,14 @@
import { ReactNode } from 'react';
import { useSortable } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
import { GripVertical } from 'lucide-react';
import { ReactNode } from "react";
import { useSortable } from "@dnd-kit/sortable";
import { CSS } from "@dnd-kit/utilities";
import { GripVertical } from "lucide-react";
interface DraggableItemProps {
id: string;
children: ReactNode;
}
export function DraggableItem({ id, children }: DraggableItemProps) {
export default function DraggableItem({ id, children }: DraggableItemProps) {
const {
attributes,
listeners,
@@ -29,7 +29,7 @@ export function DraggableItem({ id, children }: DraggableItemProps) {
ref={setNodeRef}
style={style}
className={`bg-white border border-gray-200 rounded-lg p-4 mb-3 flex items-center gap-3 shadow-sm hover:shadow-md transition-shadow ${
isDragging ? 'cursor-grabbing' : 'cursor-grab'
isDragging ? "cursor-grabbing" : "cursor-grab"
}`}
>
<div