import Taro, { Component } from '@tarojs/taro' import { View, Image, Input } from '@tarojs/components' import iconClose from './assets/clear.png' import './index.scss' export default class InputItem extends Component { static defaultProps = { type: 'text', value: '', placeholder: '', focus: false, password: false, compStyle: '', inputStyle: '', onInput: () => {}, onFocus: () => {}, onBlur: () => {} } handleInput = (e) => { this.props.onInput(e.detail.value) } handleClear = () => { this.props.onInput('') } render () { const { type, value, placeholder, focus, password, compStyle, inputStyle, onFocus, onBlur } = this.props return ( {!!value && } ) } }