Commit a75e2ee1 authored by zhangwenshuai's avatar zhangwenshuai

模糊搜索选项增加tooltip

parent eb47abde
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<Props, State> {
render() {
const { data, value } = this.state;
const { selfCom, autoFocus, onChange, ...rest } = this.props;
const { selfCom, autoFocus, onChange, showTooltip, ...rest } = this.props;
return (
<Consumer>
{({ locale }: any) => {
......@@ -249,7 +250,13 @@ class AssociationSearch extends React.Component<Props, State> {
{data.map((d: any) => {
return (
<Select.Option key={d.value} value={d.value}>
{showTooltip ? (
<Tooltip placement="topLeft" title={d.label}>
{d.label}
</Tooltip>
) : (
d.label
)}
</Select.Option>
);
})}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment