import { Input, View } from "@tarojs/components"; import { memo, ReactHTMLElement, ReactNode, useDebugValue, useMemo } from "react"; import styles from './index.module.scss'; type Params = { showIcon?: false|true, disabled?: false|true, placeholder?: string, title?: string, showTitle?: false|true, showBorder?: false|true, changeOnInput?: (string) => void, clickOnInput?: () => void, children?: ReactNode height?: string, titleStyle?: Object, styleObj?: Object } export default memo((props: Params) => { let { showTitle = true, title = '标题', showIcon = false, disabled = false, placeholder = '请输入', showBorder = true, changeOnInput, clickOnInput, height = '80rpx', titleStyle = {} } = props let stylen = useMemo(() => { if(!showBorder) { return { borderBottom: 0 } } return {} }, [showBorder]) return ( {showTitle&&{title}} {!props.children&& clickOnInput?.()} onInput={(e) => changeOnInput?.(e.detail.value)}/> ||<>{props.children} } {showIcon&&} ) })