picker和u-picker的赋值区别

<view class="templateItem bg-ff radius-15">
						<view class="template" style="width: 94%;">
							<picker @change="bindPickerChange" :value="index1" :range="arrayPyf" range-key="realName">
								<image src="https://document.dxznjy.com/course/7d53c96e7f404f429a49eb1f06f4e4e6.png" class="w44"></image>
								<view>拼音法抗遗忘</view>
							</picker>
						</view>
						<view class="template">
							 <u-picker :show="show2" :immediateChange ='true' :columns="arrayPyf" title='请选择您的孩子' keyName="realName" confirmColor="#357B71" @confirm="confirm2" @cancel='cancel2' @change="changeHandler2"></u-picker>
							 <view @click="selectPerson">
							 	<image src="https://document.dxznjy.com/course/7d53c96e7f404f429a49eb1f06f4e4e6.png" class="w44"></image>
							 	<view>拼音法抗遗忘</view>
							 </view>
						</view>
					</view>
//初始定值    arrayPyf: []
// 获取学员列表
			async getStudent() {
				let that = this;
				let loginMobile = uni.getStorageSync('LoginMobile');
				// console.log(loginMobile);
				that.StudentCodeKey = "review_" + loginMobile;
				let result = await httpUser.get("znyy/review/query/my/student");
				if (result != undefined && result != '') {
					if (result.data.data != null) {
						that.arrayStudent = result.data.data;
						console.log('that.arrayStudent--',that.arrayStudent);
						//获取拼音法抗遗忘接口人员数据
						that.arrayPyf=that.arrayStudent.map((item,index,array)=>{
							return{
								realName:item.realName,
								studentCode:item.studentCode,
							}
						})
						console.log('arrayPyf',that.arrayPyf);
						// picker直接使用 不需要
						that.arrayPyf=that.arrayPyf
						// u-picker外面要再套一个数组
						that.arrayPyf=[that.arrayPyf]
					}
				}
			},

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值