使用 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
报的不是一个错误,但是这个办法能解决问题