2***@qq.com
2***@qq.com
  • 发布:2023-07-25 18:53
  • 更新:2024-03-26 18:04
  • 阅读:285

#插件讨论# 【 zxz-uni-data-select 下拉框选择器】使用时报错

分类:uni-app

使用时报错,怎么解决?
[Vue warn]: Error in callback for watcher "mixinDatacomResData": "TypeError: defValue.forEach is not a function"

found in

---> <UniStatSelect> at components/zxz-uni-data-select/zxz-uni-data-select.vue
<UniFormsItem> at uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue
<Zysq> at pages/work/qy_bpsq/form_componects/zysq.vue
<UniForms> at uni_modules/uni-forms/components/uni-forms/uni-forms.vue
<UniSection> at components/uni-section/uni-section.vue
at pages/work/qy_bpsq/form1.vue
18:44:16.074 [system]TypeError: defValue.forEach is not a function
at VueComponent.initDefVal (webpack-internal:///7abx:339:18)
at VueComponent.handler (webpack-internal:///7abx:241:16)
at Watcher.run (http://localhost:9090/static/js/chunk-vendors.js:6763:19)
at flushSchedulerQueue (http://localhost:9090/static/js/chunk-vendors.js:6505:13)
at Array.<anonymous> (http://localhost:9090/static/js/chunk-vendors.js:4134:12)
at flushCallbacks (http://localhost:9090/static/js/chunk-vendors.js:4060:14)

2023-07-25 18:53 负责人:无 分享
已邀请:
1***@qq.com

1***@qq.com

看一下示例有没有问题

1***@qq.com

1***@qq.com

我也出现了,解决了吗

6***@qq.com

6***@qq.com - 1111111

插件中defValue设定为一个数组,但实际运行时可能是null、undefined或其他非数组类型,可以在获取数据后将使用了这个插件的这一项的值转为数组类型就可以了。下面为我的情况:转化前的数据类型是一个字符串"1727935171532488706,1727930871070654466,1727930676480114690",需要将这个字符串进行数组话,我使用的是formData.value.name = formData.value.name.split(',')这个命令,数组话以后就可以得到一个数组型的name的值,就可以在进行后面的操作了

要回复问题请先登录注册