[system] TypeError: defValue.map is not a function
at VueComponent.initDefVal (zxz-select.vue:320)
at VueComponent.handler (zxz-select.vue:271)
at Watcher.run (chunk-vendors.js:6926)
at flushSchedulerQueue (chunk-vendors.js:6668)
at Array.<anonymous> (chunk-vendors.js:4297)
at flushCallbacks (chunk-vendors.js:4223)
和
chunk-vendors.js:2928 [Vue warn]: Error in callback for watcher "mixinDatacomResData": "TypeError: defValue.map is not a function"
found in
---> <UniStatSelect> at components/zxz-select.vue
<UFormItem> at uni_modules/uview-ui/components/u-form-item/u-form-item.vue
<UForm> at uni_modules/uview-ui/components/u-form/u-form.vue
<UTransition> at uni_modules/uview-ui/components/u-transition/u-transition.vue
<UPopup> at uni_modules/uview-ui/components/u-popup/u-popup.vue
at pages/dispatch/detailc.vue
1 个回复
6***@qq.com - 1111111
插件中defValue设定为一个数组,但实际运行时可能是null、undefined或其他非数组类型,可以在获取数据后将使用了这个插件的这一项的值转为数组类型就可以了。下面为我的情况:转化前的数据类型是一个字符串"1727935171532488706,1727930871070654466,1727930676480114690",需要将这个字符串进行数组话,我使用的是formData.value.name = formData.value.name.split(',')这个命令,数组话以后就可以得到一个数组型的name的值,就可以在进行后面的操作了