使用 uni-data-select 我的数据显示没有问题,但是控制台报错,我明明没使用服务空间呀。

Error in callback for watcher “function () {var e = [];return [“pageCurrent”, “pageSize”, “localdata”, “collection”, “action”, “field”, “orderby”, “where”, “getont”, “getcount”, “gettree”, “groupby”, “groupField”, “distinct”].forEach(function (t) {e.push(_this18[t]);}), e;}”: “TypeError: n.collection is not a function”

在这里插入图片描述
下面 加个 v-if="show"判断就好了。

<uni-data-select   v-if="show" v-model="equipform.equipClassify" :localdata="classificationOptions">
</uni-data-select>
classificationOptions: [],
show:false,
getEquipRiskTypeList() {
				this.request('/dictData/getByType/equip_risk_type', '', 'GET').then(res => {
					if (res.success) {
						this.classificationOptions = res.result.map((item) => {
							return {
								value: item.value,
								text: item.title
							}
						});
						 this.show=true
					}
				})
			},

指路:https://blog.csdn.net/L6X1999/article/details/124968992
报的不是一个错误,但是这个办法能解决问题

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐