更新图标
This commit is contained in:
@@ -9,4 +9,8 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.icon_a_btn{
|
||||
font-size: 30px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { View } from "@tarojs/components"
|
||||
import { View, Text } from "@tarojs/components"
|
||||
import { memo } from "react"
|
||||
import style from "./index.module.scss"
|
||||
|
||||
@@ -11,8 +11,10 @@ export default memo(({onClose, styleObj = {}}:Params) => {
|
||||
return (
|
||||
<View
|
||||
style={styleObj}
|
||||
className={`iconfont icon-cuo ${style.icon_a_cuowuwrong_self}`}
|
||||
className={style.icon_a_cuowuwrong_self}
|
||||
onClick={onClose}
|
||||
></View>
|
||||
>
|
||||
<Text className={`iconfont icon-qingkong ${style.icon_a_btn}`}></Text>
|
||||
</View>
|
||||
)
|
||||
})
|
||||
@@ -3,7 +3,7 @@ import styles from "./index.module.scss"
|
||||
import CloseBtn from "@/components/closeBtn"
|
||||
import classnames from "classnames";
|
||||
import { debounce } from "@/common/util";
|
||||
import { memo, useEffect, useRef, useState } from "react";
|
||||
import { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from "react";
|
||||
|
||||
type Params = {
|
||||
clickOnSearch?: (val: string) => void
|
||||
@@ -19,7 +19,7 @@ type Params = {
|
||||
debounceTime?: number //防抖时间,不设默认为零
|
||||
}
|
||||
|
||||
export default memo(({
|
||||
export default forwardRef(({
|
||||
clickOnSearch,
|
||||
changeOnSearch,
|
||||
disabled = false,
|
||||
@@ -29,8 +29,8 @@ export default memo(({
|
||||
btnStyle = {},
|
||||
placeIcon = 'inner',
|
||||
btnTitle = '搜索',
|
||||
debounceTime = 0
|
||||
}:Params) => {
|
||||
debounceTime = 0,
|
||||
}:Params, ref) => {
|
||||
const [inputCon , setInputCon] = useState('')
|
||||
const debounceTimeRef = useRef(0)
|
||||
|
||||
@@ -43,6 +43,10 @@ export default memo(({
|
||||
changeData(value)
|
||||
}
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
clearInput
|
||||
}))
|
||||
|
||||
const clearInput = () => {
|
||||
setInputCon('')
|
||||
changeOnSearch?.('')
|
||||
|
||||
Reference in New Issue
Block a user