Commit bf505b90 authored by zhangwenshuai's avatar zhangwenshuai

修改可输可选样式

parent bff7ae83
......@@ -9,19 +9,25 @@ export const ApolloInputSearchDetail = (props: SearchProps) => {
const { isMultiple } = componentAttr || {};
const selfAttr: any = isMultiple ? { maxTagCount: 2 } : { maxTagCount: 1 };
if (typeof value === 'object') {
const tagsVal = value.filter((ls) => {
return ls.value;
});
const textVal = value.filter((ls) => {
return !ls.value;
});
return (
<div>
{tagsVal.length > 0 ? <Tag value={tagsVal} {...selfAttr} /> : null}
{textVal.length > 0 ? <div className={styles.text}>{textVal[0].text}</div> : null}
{value.length > 0 ? <div className={styles.text}>{value[0].text}</div> : null}
</div>
);
}
// if (typeof value === 'object') {
// const tagsVal = value.filter((ls) => {
// return ls.value;
// });
// const textVal = value.filter((ls) => {
// return !ls.value;
// });
// return (
// <div>
// {tagsVal.length > 0 ? <Tag value={tagsVal} {...selfAttr} /> : null}
// {textVal.length > 0 ? <div className={styles.text}>{textVal[0].text}</div> : null}
// </div>
// );
// }
};
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