react-weui icon indicating copy to clipboard operation
react-weui copied to clipboard

建议SearchBar组件增加方法setValue

Open jonahfang opened this issue 8 years ago • 1 comments

Do you want to request a feature or report a bug (建议还是bug) ? 建议 What is the current behavior? (现有状况) 搜索结果跳转后,回到搜索界面,需要恢复原来输入的搜索条件值和搜索结果, 现在没有办法做 What is the expected behavior? (应有状况) 通过增加下列方法可以实现上述要求:

    //public
    setValue (v) {
        this.setState({text:v,focus:true})
        if(this.props.onChange) this.props.onChange(v)
    }

Which versions of React-weui, weui, and which OS and device are affected by this issue? (React-weui版本 weui版本 机型和系统) react-weui 1.0.4

jonahfang avatar Feb 10 '17 05:02 jonahfang

谢谢建议 的确 之后可以加个defaultValue这样的属性来设置默认

n7best avatar Feb 10 '17 20:02 n7best