From 812af67271f4c299e55479f544baaf9d25f5897d Mon Sep 17 00:00:00 2001 From: manzhenhua Date: Sat, 23 May 2020 18:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ant_components/BIInput/index.js | 25 ++++++++++++++++--------- ant_components/BIInput/style.less | 17 +++-------------- components/IconFont/IconFont.ts | 2 +- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ant_components/BIInput/index.js b/ant_components/BIInput/index.js index 478df27..4de4eb4 100644 --- a/ant_components/BIInput/index.js +++ b/ant_components/BIInput/index.js @@ -1,6 +1,7 @@ import React from 'react'; import { Input } from 'antd'; -import './style.less'; +import InconFont from '@/submodule/components/IconFont/IconFont'; +import styles from './style.less'; const { TextArea } = Input; const Search = Input.Search; @@ -12,15 +13,21 @@ const Password = Input.Password; * 只扩展自定义样式 * */ -class BIInput extends React.Component { - - render() { - return ( - - - - ); +const BIInput = (props) => { + const onClear = () => { + if (props.onChange) { + props.onChange('') + } + if (props.onClear) { + props.onClear('') + } } + return ( + ) : null} + {...props} + /> + ); } export default BIInput; diff --git a/ant_components/BIInput/style.less b/ant_components/BIInput/style.less index 63aa998..d854e75 100644 --- a/ant_components/BIInput/style.less +++ b/ant_components/BIInput/style.less @@ -1,17 +1,6 @@ @import "../config.less"; -:global .BIInput { - .ant-input { - border-radius: 4px; - } - .ant-input:hover { - //border: 1px solid @base-green; - } - .ant-input:focus{ - //border: 1px solid @base-green; - //box-shadow: 0 0 0 2px @base-green-shadow; - } - .ant-input-affix-wrapper:hover .ant-input:not(.ant-input-disabled) { - //border-color: @base-green; - } +.clearIcon{ + color:rgba(0, 0, 0, 0.25); + font-size: 12px; } diff --git a/components/IconFont/IconFont.ts b/components/IconFont/IconFont.ts index 9f1a4c3..9c6a9fa 100755 --- a/components/IconFont/IconFont.ts +++ b/components/IconFont/IconFont.ts @@ -1,7 +1,7 @@ import { createFromIconfontCN } from '@ant-design/icons'; const IconFont = createFromIconfontCN({ - scriptUrl: '//at.alicdn.com/t/font_1509781_z48eeampujo.js', + scriptUrl: '//at.alicdn.com/t/font_1509781_g70awna9ne.js', }); export default IconFont; -- 2.21.0