loadFirstShowPic: function () {
var imgUrls = this.data.imgUrls;
var query = new AV.Query('_File');
query.startWith('name', '首页展示');
query.find().then(function (results) {
results.map(function (result) {
imgUrls.push(result.get('url'));
console.log(result.get('url'));
})
})
this.setData({ imgUrls: imgUrls });
},
onReady: function() {
this.loadFirstShowPic();
}
如上的代码,我想获取所有符合规定的文件的url,但是,微信小程序却提醒一下错误:
WAService.js:1 thirdScriptError
query.startWith is not a function;at "pages/show/index/index" page loadFirstShowPic function
TypeError: query.startWith is not a function
at e.loadFirstShowPic (http://804348251.appservice.open.weixin.qq.com/pages/show/index/index.js:44:11)
at e.<anonymous> (http://804348251.appservice.open.weixin.qq.com/WAService.js:3:29333)
at e.onReady (http://804348251.appservice.open.weixin.qq.com/pages/show/index/index.js:54:10)
at e.<anonymous> (http://804348251.appservice.open.weixin.qq.com/WAService.js:3:28856)
at A (http://804348251.appservice.open.weixin.qq.com/WAService.js:3:21142)
at .<anonymous> (http://804348251.appservice.open.weixin.qq.com/WAService.js:3:22477)
at http://804348251.appservice.open.weixin.qq.com/WAService.js:3:26239
at http://804348251.appservice.open.weixin.qq.com/WAService.js:1:26737
at Object.e.(anonymous function) [as PAGE_EVENT] (http://804348251.appservice.open.weixin.qq.com/WAService.js:2:4086)
at n.<anonymous> (http://804348251.appservice.open.weixin.qq.com/asdebug.js:1:12936)
这是为什么?