当前位置:网站首页>picker选择器出现object解决办法
picker选择器出现object解决办法
2022-08-11 08:17:00 【德宏大魔王】
背景:没错,这次也是做项目遇到的问题,简单的记一下,我之前在做人脉小程序的时候也遇到了,不过那个时候水平太低没能解决,今天解决了我就记录一下
问题是这样的

前端写的假数据是这样的
js:
前端wxml
<picker mode="selector" range="{
{array}}" value="{
{index}}" bindchange="bindPickerChange" class="picker" style="width:580rpx;">
<view>{
{array[index]}}</view>
</picker>
对接我的数据后
array变成了
{
"code": 100,
"data": [
{
"id": 1,
"funding_name": "财政资金4"
},
{
"id": 2,
"funding_name": "企业资金"
}],
"msg": "success"
}

可以看到,多了一层嵌套
解决办法 :
前端wxml 加一个
range-key=“funding_name”
也就是
<picker mode="selector" range="{
{array}}" range-key="funding_name" value="{
{index}}" bindchange="bindPickerChange" class="picker" style="width:580rpx;">
<view>{
{array[index]['funding_name']}}</view>
</picker>
最后成功截图
最后
️️️️️️ 🥳🥳🥳 茫茫人海千千万万,感谢这一刻你看到了我的文章,感谢观赏,大家好呀,欢迎加入人工智能交流群(看我的动态),更多周边福利等你🥳🥳🥳
欢迎订阅本专栏或者关注我,大家一起努力每天一题算法题
️️️ 最后,希望我的这篇文章能对你的有所帮助!
愿自己还有你在未来的日子,保持学习,保持进步,保持热爱,奔赴山海! ️️️
边栏推荐
猜你喜欢

机器学习(二)线性回归

Nuget找不到包的问题处理

Redis 只会用缓存?20种妙用让同事直呼牛X(荣耀典藏版)

Do you know the basic process and use case design method of interface testing?

Project 1 - PM2.5 Forecast

FPGA 20个例程篇:11.USB2.0接收并回复CRC16位校验

C Primer Plus(6) 中文版 第1章 初识C语言 1.7 使用C语言的7个步骤

My creative anniversary丨Thank you for being with you for these 365 days, not forgetting the original intention, and each is wonderful

租房小程序

3.2 - classification - Logistic regression
随机推荐
IQUNIX A80 exploring TTC金粉 初体验
Nuget can't find the package problem
C Primer Plus(6) 中文版 第1章 初识C语言 1.7 使用C语言的7个步骤
笔试题大疆08.07
C Primer Plus(6) 中文版 第1章 初识C语言 1.1 C语言的起源 1.2 选择C语言的理由 1.3 C语言的应用范围
RestTemplate工具类
pyqt5实现仪表盘
2021-08-11 For loop combined with multi-threaded asynchronous query and collect results
兼容并蓄广纳百川,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang复合容器类型的声明和使用EP04
Four startup modes of Activity
【Day_13 0509】▲跳石板
欧拉函数(用欧拉筛法求欧拉函数)
Use tf.argmax in Tensorflow to return the index of the maximum value of the tensor along the specified dimension
关于#sql#的问题:怎么将下面的数据按逗号分隔成多行,以列的形式展示出来
装饰器模式:Swift 实现
快速幂,逆元的求解
Distributed Lock-Redission - Cache Consistency Solution
【云原生】云原生在网络安全领域的应用
初级软件测试工程师笔试试题,你知道答案吗?
matplotlib
