option-tag style (#92)

This commit is contained in:
ChengLei Shao 2021-10-25 09:58:02 +08:00 committed by GitHub
parent 76d3b3f64d
commit 90b7c9fc94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -0,0 +1,3 @@
.option-tag ~ .option-tag::before {
content: " , ";
}

View File

@ -34,6 +34,8 @@ import { Resource } from '../../resource';
import { useRequest } from 'ahooks';
import constate from 'constate';
import './index.less';
export const Select: any = connect(
(props) => {
const { options = [], ...others } = props;
@ -542,7 +544,9 @@ Select.OptionTag = observer((props) => {
const { data, fieldNames } = useContext(OptionTagContext);
return (
<VisibleContext.Provider value={[visible, setVisible]}>
<a onClick={() => setVisible(true)}>{data[fieldNames.label]}</a>
<a className="option-tag" onClick={() => setVisible(true)}>
{data[fieldNames.label]}
</a>
{props.children}
</VisibleContext.Provider>
);