uni piker选择器选不中的问题
这是我的代码
<picker mode="selector" :range="typeData" :value="typeValue" @change="typeChange">
<view class="uni-input">{{typeValue}} <text class="iconfont icon-xiala"></text></view>
</picker>
data 中定义的数据,写的方法
typeData: ['全部类型','扫码支付','扫码收入','转账支出','转账收入','通贝转入','金贝转出'],
typeValue: '全部类型1',
typeValueIndex:0,
typeChange(e) {
console.log('e', e)
console.log('e.target.value', e.target.value)
this.typeValue = this.typeData[e.target.value];
this.typeValueIndex=e.target.value;
},
控制台打印出来的效果
选择全部类型的时候,一次是NaN,一次是可以正确选择,不知道是哪个地方的问题