From a75e2ee161d018e5bb167002bc93b2082bf07beb Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Tue, 26 Jan 2021 17:33:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E7=B3=8A=E6=90=9C=E7=B4=A2=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=A2=9E=E5=8A=A0tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/extra/associationSearch/index.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/components/apolloTable/component/base/extra/associationSearch/index.tsx b/components/apolloTable/component/base/extra/associationSearch/index.tsx index 6f4bb94..20ef279 100644 --- a/components/apolloTable/component/base/extra/associationSearch/index.tsx +++ b/components/apolloTable/component/base/extra/associationSearch/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Spin, Select } from 'antd'; +import {Spin, Select, Tooltip} from 'antd'; import lodash from 'lodash'; import { Consumer } from '../../../context'; @@ -17,6 +17,7 @@ interface Props { value: any; label: string; }; + showTooltip?: boolean; } enum Loaded { @@ -229,7 +230,7 @@ class AssociationSearch extends React.Component { render() { const { data, value } = this.state; - const { selfCom, autoFocus, onChange, ...rest } = this.props; + const { selfCom, autoFocus, onChange, showTooltip, ...rest } = this.props; return ( {({ locale }: any) => { @@ -249,7 +250,13 @@ class AssociationSearch extends React.Component { {data.map((d: any) => { return ( - {d.label} + {showTooltip ? ( + + {d.label} + + ) : ( + d.label + )} ); })} -- 2.21.0