Wux weapp 组件库的 bug—— wux-picker选择器组件无法正确初始化到选定的value

options的value为Number,组件无法正常使用

解决方案,修改picker-view/utils.js中的getIndexFromValue函数,如下:

JavaScript 复制代码
export function getIndexFromValue(value, col = [], fieldNames = DEFAULT_FIELD_NAMES) {
  //return getRealIndex(col.map((v) => v[fieldNames.value]).indexOf(value), 0, col.length - 1)
  if(value == null){
    return 0
  }
  return getRealIndex(col.map((v) => v[fieldNames.value].toString()).indexOf(value.toString()), 0, col.length - 1)
}
相关推荐
肖有米XTKF86467 小时前
肖有米团队开发:青蓝山泉送水模式系统
小程序·团队开发·零售·csdn开发云
double_eggm10 小时前
微信小程序7
微信小程序·小程序
程序鉴定师11 小时前
上海小程序开发的坚实保障与行业优势解析
大数据·小程序
double_eggm21 小时前
微信小程序8
微信小程序·小程序
MageGojo1 天前
小程序每日一谜怎么做:riddle 接口接入示例
windows·小程序·apache·谜语
kyh10033811201 天前
Cocos Creator 《打螺丝消除游戏》源码+实现
游戏·微信小程序·小程序·打螺丝小游戏源码·微笑小游戏源码
烂不烂问厨房2 天前
支付宝小程序camera录制视频并上传注意事项
小程序·音视频
我是伪码农2 天前
小程序125-150
小程序
帅次2 天前
讯飞与腾讯云:Android 实时语音识别服务对比选择
android·ios·微信小程序·小程序·android studio·android runtime
Chengbei112 天前
小程序 AI 渗透新工具MCP!打通调试与安全检测、网络抓包、接口分析、越权检测一站式实现
人工智能·安全·web安全·搜索引擎·网络安全·小程序·系统安全