input框切换时有原输入内容,怎么解决?
<block wx:if="{{index>40}}">
<view>
<block wx:for="{{questions[index-1][2]}}" wx:for-index="i">
<block wx:if="{{item != ''}}">
<text>{{item}}</text>
</block>
<block wx:if="{{item == ''}}">
<text>(</text><text style="color: red;">{{questions[index-1][3][0][i]}}</text><text>)</text>
</block>
</block>
<view>
<input value="{{questions[index-1][5]}}" type="text" bindinput="input" data-i="{{index}}" placeholder ="请输入答案"/>
</view>
</view>
</block>
js只赋值一次
input(e){
let str = e.detail.value
let i = e.target.dataset.i
let question = this.data.questions[i-1]
let len = question[3][0].length
for(let j=0,k=0;j<len;j++){
if(question[3][0][j] != "&^&"){
question[3][0][j]=str.slice(k,k+1)
k += 1
}
}
question[5] = str.slice(0,question[3][1])
this.setData({
['questions[' + (i-1) +']']:question
})
},
怎么造成了点击下一题时还有原来输入的内容,微信的问题还是我的问题