更新图标

This commit is contained in:
2022-05-09 11:58:33 +08:00
parent d5622d5b0a
commit b5e967779c
20 changed files with 1934 additions and 32 deletions
@@ -9,4 +9,8 @@
display: flex;
justify-content: center;
align-items: center;
.icon_a_btn{
font-size: 30px;
margin-top: 3px;
}
}
+5 -3
View File
@@ -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>
)
})
+8 -4
View File
@@ -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?.('')