代码改变世界

Taro初学者遇到的坑

2020-08-28 12:10  小罗世界  阅读(469)  评论(0)    收藏  举报

对于taro中input框,输入框的值必须要通过onInput来绑定值,

实例:

 bindValue (name, e) {
    this.setState({
      [name]: e.target.value,
      show_clean:true
    })
  }
 
<Input className='form-input' type='text' placeholder='请填写你的姓名' value={userName} onInput={this.bindValue.bind(this, 'userName')}></Input>
 
taro跳转h5页面,通过Taro.navegateTo()是不能实现的,具体来说到底能不能实现我不知道,
通过这个来实现 window.location.href = 'https://www.witfintech.net/marketing/11cmbzc/?channel=3nzg8qbhom'