You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classIndexextendsComponent{constructor(props){super(props)this.state={currentTab: 0,name: ''}}swiperHandler=(e)=>{console.log('swiperHandler',e)const{ current =0}=e.detail||{}this.setState({currentTab: current})}changeInput=(e)=>{console.log('changeInput',e)const{ value }=e.detail||{}this.setState({name: value})}render(){const{ currentTab =0, name }=this.statereturn(<ViewclassName='container'><ViewclassName='box'><Swipercurrent={currentTab}duration={300}onChange={this.swiperHandler}className='swiper'><SwiperItem><Text>第一页:当前swiper索引值-{currentTab}</Text></SwiperItem><SwiperItem><Text>第二页:当前swiper索引值-{currentTab}</Text><Inputvalue={name}placeholder='请输入姓名'onChange={this.changeInput}/></SwiperItem></Swiper></View></View>)}}exportdefaultIndex
期望行为
1、页面不跳转
2、输入值能正常获取到
报错信息
无报错信息
系统信息
Taro 2.0.4
The text was updated successfully, but these errors were encountered:
再非第一个tab的页面往input中输入值时,触发onchange事件后页面会自动跳转至第一页且onchange事件无法获取到输入的值
复现步骤
期望行为
1、页面不跳转
2、输入值能正常获取到
报错信息
无报错信息
系统信息
Taro 2.0.4
The text was updated successfully, but these errors were encountered: