From 84849298dd2caa0afac23beed28e682dda2cb08c Mon Sep 17 00:00:00 2001 From: brightzhli <864345220@qq.com> Date: Thu, 19 Sep 2024 10:57:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(tabs):=20=E8=B0=83=E6=95=B4dragSorter?= =?UTF-8?q?=E5=A3=B0=E6=98=8E=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 1 + src/tabs/tabs.tsx | 19 ++++++------------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2fe97ca..e39c830 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,6 +13,7 @@ export * from './common'; export * from './divider'; export * from './dropdown'; export * from './grid'; +export * from './hooks'; export * from './image'; export * from './input'; export * from './input-number'; diff --git a/src/tabs/tabs.tsx b/src/tabs/tabs.tsx index 54d98e6..087af58 100644 --- a/src/tabs/tabs.tsx +++ b/src/tabs/tabs.tsx @@ -41,14 +41,7 @@ export default class Tabs extends Component { targetClassNameRegExpStr = `^${this.tabClasses.tdTabsClassPrefix}(__nav-item|__nav-item-wrapper|__nav-item-text-wrapper)`; - dragSorter = new UseDragSorter({ - ...this.props, - sortOnDraggable: this.props.dragSort, - onDragOverCheck: { - x: true, - targetClassNameRegExp: new RegExp(this.targetClassNameRegExpStr), - }, - }); + dragSorter: UseDragSorter | null = null; memoChildren = () => { const { list, children } = this.props; @@ -102,7 +95,7 @@ export default class Tabs extends Component { > { this.props.defaultValue === undefined && Array.isArray(this.itemList) && this.itemList.length !== 0 ? this.itemList[0].value : this.props.defaultValue; - } - - render(props: TabsProps) { - const { className, style } = props; this.dragSorter = new UseDragSorter({ ...this.props, @@ -131,6 +120,10 @@ export default class Tabs extends Component { targetClassNameRegExp: new RegExp(this.targetClassNameRegExpStr), }, }); + } + + render(props: TabsProps) { + const { className, style } = props; return (