From 74babad7b08112ebb434cfd0a1645f29fba479a4 Mon Sep 17 00:00:00 2001 From: WORLDI <66404428+WORLDI@users.noreply.github.com> Date: Thu, 22 Oct 2020 09:58:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(dropdown):=20=E4=BF=AE=E5=A4=8DDropdown?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=B8=ADplacement=E6=96=B9=E5=90=91=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E7=94=B112=E4=B8=AA=E6=96=B9?= =?UTF-8?q?=E5=90=91=E6=94=B9=E4=B8=BA=E5=8F=AA=E6=9C=89=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?6=E4=B8=AA=E6=96=B9=E5=90=91=E5=8F=AF=E9=80=89=EF=BC=8C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=96=B9=E5=90=91=E4=B8=BA=E4=B8=8B=20(#333)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit affects: @gio-design/components, website 修复Dropdown组件中placement方向的问题,由12个方向改为只有上下6个方向可选,默认方向为下 --- packages/components/src/components/dropdown/Dropdown.tsx | 5 +++-- .../website/src/components/functional/dropdown/demo/base.tsx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/components/src/components/dropdown/Dropdown.tsx b/packages/components/src/components/dropdown/Dropdown.tsx index ad7d6acc3f..791c11327f 100644 --- a/packages/components/src/components/dropdown/Dropdown.tsx +++ b/packages/components/src/components/dropdown/Dropdown.tsx @@ -1,11 +1,12 @@ import React, { useContext, cloneElement } from 'react'; +import { isFunction } from 'lodash'; import Tooltip from '../tooltip'; import { DropdownProps } from './interface'; import { ConfigContext } from '../config-provider'; import useControlledState from '../../utils/hooks/useControlledState'; -import { isFunction } from 'lodash'; const Dropdown = (props: DropdownProps) => { + const placementList = ['top','bottom','topLeft','topRight','bottomLeft','bottomRight']; const { children, prefixCls: customizePrefixCls, @@ -33,7 +34,7 @@ const Dropdown = (props: DropdownProps) => { { diff --git a/packages/website/src/components/functional/dropdown/demo/base.tsx b/packages/website/src/components/functional/dropdown/demo/base.tsx index 7245f106a0..bcbacbcd05 100644 --- a/packages/website/src/components/functional/dropdown/demo/base.tsx +++ b/packages/website/src/components/functional/dropdown/demo/base.tsx @@ -4,7 +4,7 @@ import '@gio-design/components/es/components/dropdown/style/index.css'; export default () => ( ( > 内容区域 - } + )} placement="bottomRight" >