uniapp选择框下拉列表

<template>
<!-- 下拉列表 -->
<view>
<view class="index">
<view class="flex-row flex">
<view class="mybill-text">提现方式:</view>
<view class="mybill-text">
<select v-model="editSelectTypeLists" class="selectType" @change="selectTypeChange"
ref="addRequestState">
<option v-for="(item,index) in selectTypeLists" :key="index" :value="item.value">{{item.name}}
</option>
</select>
</view>
</view>
</view>
</view>
</template>

<script>
export default {
data() {
return {
selectTypeLists: [{
value: "0",
name: '银行卡提现(默认方式)'
},
{
value: "1",
name: '微信提现'
}
],
withdrawType: '',
wxDepositShow: false,
}
},
created() {
this.editSelectTypeLists = this.selectTypeLists[1].value; /* 默认选中 */
},
methods: {
selectTypeChange() {
let index = this.$refs.addRequestState.value
console.log("index:" + index)
},
}
}
</script>

上一篇:图书目录,并进行排序--C primer plus,14章练习题3


下一篇:c++ 读取数量不定的数据