美文网首页
uniappPicker选择器默认值

uniappPicker选择器默认值

作者: 爱学习的新一 | 来源:发表于2020-10-08 18:37 被阅读0次
<picker @change="bindPickerChange" :value="index" :range="ValueList" >
        <tui-list-cell  :arrow="true" last="true" @tap="bindPicker">
            <view class="tui-item-box">
                <text class="tui-list-cell_name">申请原因</text>
                <input type="text" :value="ValueText"   class="tui-input" disabled="flase" :class="{ activeColor: flagColor }"/>
            
            </view>
        </tui-list-cell>
        </picker>
<script>
export default {
        data() {
            return {
            
                 index: 0,
                 ValueList:[],
                 ValueText:'请选择申请原因',//默认值
                 flagColor:false
                
            }
        },
      methods:{
        
              bindPickerChange: function(e) {
            
                    console.log('picker发送选择改变,携带值为', e.target.value)
                    this.index = e.target.value
                    this.ValueText = this.ValueList[e.target.value]
                    this.flagColor = true
                    
                },
        }

}
</script>

相关文章

网友评论

      本文标题:uniappPicker选择器默认值

      本文链接:https://www.haomeiwen.com/subject/yyuhpktx.html