From 8d860f892e03bcb48d10220e8b2434e5280a8dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 3 Aug 2022 11:22:18 +0800 Subject: [PATCH 1/9] chore: basic refactor --- docs/examples/basic.tsx | 43 +++++++++++++++++++++--------------- src/TabNavList/TabNode.tsx | 10 ++++----- src/TabPanelList/TabPane.tsx | 2 +- src/TabPanelList/index.tsx | 23 +++++++++++-------- src/Tabs.tsx | 30 +++++-------------------- src/interface.ts | 1 - 6 files changed, 51 insertions(+), 58 deletions(-) diff --git a/docs/examples/basic.tsx b/docs/examples/basic.tsx index c92eed9f..f92b79f9 100644 --- a/docs/examples/basic.tsx +++ b/docs/examples/basic.tsx @@ -1,19 +1,26 @@ import React from 'react'; -import Tabs, { TabPane } from 'rc-tabs'; +import Tabs from 'rc-tabs'; import '../../assets/index.less'; export default () => { const [destroy, setDestroy] = React.useState(false); - const [children, setChildren] = React.useState([ - - Light - , - - Bamboo - , - - Cute - , + const [items, setItems] = React.useState([ + { + label: 'Light', + key: 'light', + children: 'Light!', + }, + { + label: 'Bamboo', + key: 'bamboo', + children: 'Bamboo!', + }, + { + label: 'Cute', + key: 'cute', + children: 'Cute!', + disabled: true, + }, ]); if (destroy) { @@ -22,16 +29,16 @@ export default () => { return ( - - {children} - +