当前位置:网站首页>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>
最后成功截图
最后
️️️️️️ 🥳🥳🥳 茫茫人海千千万万,感谢这一刻你看到了我的文章,感谢观赏,大家好呀,欢迎加入人工智能交流群(看我的动态),更多周边福利等你🥳🥳🥳
欢迎订阅本专栏或者关注我,大家一起努力每天一题算法题
️️️ 最后,希望我的这篇文章能对你的有所帮助!
愿自己还有你在未来的日子,保持学习,保持进步,保持热爱,奔赴山海! ️️️
边栏推荐
- 【43. 字符串相乘】
- Analysys and the Alliance of Small and Medium Banks jointly released the Hainan Digital Economy Index, so stay tuned!
- 基础SQL——DDL
- 2022年值得关注的NFT发展趋势
- 分布式锁-Redission - 缓存一致性解决
- 囍楽cloud task source code
- leetcode: 69. Square root of x
- 1081 Check Password (15 points)
- Write a resume like this, easy to get the interviewer
- Hibernate 的 Session 缓存相关操作
猜你喜欢
随机推荐
分布式锁-Redission - 缓存一致性解决
基于微信小程序的租房小程序
AcWing 272. 最长公共上升子序列
Notable NFT development trends in 2022
优炫数据库支持多列分区吗?
研发了 5 年的时序数据库,到底要解决什么问题?
欢迎加入sumarua网络安全交流社区
The easiest trick to support quick renaming of various files
go sqlx 包
2022-08-10:为了给刷题的同学一些奖励,力扣团队引入了一个弹簧游戏机, 游戏机由 N 个特殊弹簧排成一排,编号为 0 到 N-1, 初始有一个小球在编号 0 的弹簧处。若小球在编号为 i 的弹
JUC Concurrent Programming
轻量级网络(一):MobileNet V1,V2, V3系列
C语言-结构体
一根网线两台电脑传输文件
机器学习(二)线性回归
你有对象类,我有结构体,Go lang1.18入门精炼教程,由白丁入鸿儒,go lang结构体(struct)的使用EP06
Do you know the basic process and use case design method of interface testing?
麒麟V10系统打包Qt免安装包程序
数据库无法启动,报无法分配内存,怎么处理
抽象类和接口










