Files
douhuo-rule/components/mould-picker.vue
2023-05-15 13:33:00 +08:00

56 lines
804 B
Vue

<template>
<view>
<picker
v-if="bankList.length > 0"
:range="bankList"
range-key="title"
:value="bankValue"
@change="bindPickerChange"
>
<view class="uni-input">{{bankList[bankIndex].title}}</view>
</picker>
</view>
</template>
<script>
export default {
name: 'mouldPicker',
props: {
bankList: {
type: Array,
default: () => {
return []
}
},
bankValue: {
type: Number,
default: () => {
return []
}
}
},
data(){
return {
bankIndex: 0
}
},
watch:{
bankList(e, old){
this.bankIndex = 0;
}
},
onLoad() {
},
methods: {
bindPickerChange(e){
this.bankIndex = e.detail.value
this.$emit('bankPicker', this.bankList[e.detail.value].institution_id)
}
}
}
</script>
<style>
</style>