uni-app实现下拉效果


代码:

<view>
	 <picker @change="examinationType" :range="examinationTypeArray">
		<label>性别:</label>
		<label class="">{{ examinationTypeArrayType }}</label>
	 </picker>
</view>

//data里
examinationTypeArray:['---请选择---','男','女'],
examinationTypeIndex:0,
examinationTypeArrayType:'---请选择---',

//methods里
examinationType(e) {
    this.examinationTypeIndex = e.target.value;
    this.examinationTypeArrayType=this.examinationTypeArray[this.examinationTypeIndex]
}
原文地址:https://www.cnblogs.com/axingya/p/15003020.html