- 关于小程序打开[可视化]功能出现的错误.
创建项目时,选择[不使用云服务],[不使用模板]创建项目. [图片] 将会造成[可视化]工具找开报错. [图片] 请问我需要怎么处理,才能正常使用可视化工具? 感谢专家的帮助.
2022-01-12 - 如何在js文件中使用typeof判断变量类型?
detectType(){ wx.cloud.database().collection('test').get().then(res=>{ res.data.forEach(element => { // 判断数据类型 console.log(typeof element.price ) }); }) 提示错误: VM220:12 页面【pages/goods/list]错误: Error: module "@babel/runtime/helpers/typeof.js" is not defined at p (VM201 WAService.js:2) at r (VM201 WAService.js:2) at <anonymous>:4:16 at p (VM201 WAService.js:2) at <anonymous>:9:7 at evaluateRes (VM8 asdebug.js:1) at Object.invoke (VM8 asdebug.js:1) at r (VM8 asdebug.js:1) at T (VM201 WAService.js:2) at wa.batchInjectComponents (VM201 WAService.js:2)(env: macOS,mp,1.05.2110290; lib: 2.21.0) (anonymous) @ VM220:12 evaluateRes @ VM8 asdebug.js:1 invoke @ VM8 asdebug.js:1 r @ VM8 asdebug.js:1 T @ VM201 WAService.js:2 batchInjectComponents @ VM201 WAService.js:2 injectComponentsRecursively @ VM201 WAService.js:2 va @ VM201 WAService.js:2 create @ VM201 WAService.js:2 sr @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 pr @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 K.emit @ VM201 WAService.js:2 emit @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 K.emit @ VM201 WAService.js:2 emit @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 c @ VM8 asdebug.js:1 u @ VM8 asdebug.js:1 (anonymous) @ VM8 asdebug.js:1 f @ VM8 asdebug.js:1 g @ VM8 asdebug.js:1 (anonymous) @ VM8 asdebug.js:1 _ws.onmessage @ VM8 asdebug.js:1 VM201 WAService.js:2 Error: module "@babel/runtime/helpers/typeof.js" is not defined at p (VM201 WAService.js:2) at r (VM201 WAService.js:2) at <anonymous>:4:16 at p (VM201 WAService.js:2) at <anonymous>:9:7 at evaluateRes (VM8 asdebug.js:1) at Object.invoke (VM8 asdebug.js:1) at r (VM8 asdebug.js:1) at T (VM201 WAService.js:2) at wa.batchInjectComponents (VM201 WAService.js:2)(env: macOS,mp,1.05.2110290; lib: 2.21.0) errorReport @ VM201 WAService.js:2 thirdErrorReport @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 u @ VM201 WAService.js:2 a @ VM201 WAService.js:2 c @ VM8 asdebug.js:1 r @ VM8 asdebug.js:1 window.onerror @ VM194:1 evaluateRes @ VM8 asdebug.js:1 invoke @ VM8 asdebug.js:1 r @ VM8 asdebug.js:1 T @ VM201 WAService.js:2 batchInjectComponents @ VM201 WAService.js:2 injectComponentsRecursively @ VM201 WAService.js:2 va @ VM201 WAService.js:2 create @ VM201 WAService.js:2 sr @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 pr @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 K.emit @ VM201 WAService.js:2 emit @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 K.emit @ VM201 WAService.js:2 emit @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 c @ VM8 asdebug.js:1 u @ VM8 asdebug.js:1 (anonymous) @ VM8 asdebug.js:1 f @ VM8 asdebug.js:1 g @ VM8 asdebug.js:1 (anonymous) @ VM8 asdebug.js:1 _ws.onmessage @ VM8 asdebug.js:1 error (async) t.default @ VM194:1 160 @ VM194:1 n @ VM194:1 (anonymous) @ VM194:1 (anonymous) @ VM194:1 Show 5 more frames VM201 WAService.js:2 Error: module "@babel/runtime/helpers/typeof.js" is not defined at p (VM201 WAService.js:2) at r (VM201 WAService.js:2) at <anonymous>:4:16 at p (VM201 WAService.js:2) at <anonymous>:9:7 at evaluateRes (VM8 asdebug.js:1) at Object.invoke (VM8 asdebug.js:1) at r (VM8 asdebug.js:1) at T (VM201 WAService.js:2) at wa.batchInjectComponents (VM201 WAService.js:2)(env: macOS,mp,1.05.2110290; lib: 2.21.0) errorReport @ VM201 WAService.js:2 thirdErrorReport @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 u @ VM201 WAService.js:2 a @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 emit @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 evaluateRes @ VM8 asdebug.js:1 invoke @ VM8 asdebug.js:1 r @ VM8 asdebug.js:1 T @ VM201 WAService.js:2 batchInjectComponents @ VM201 WAService.js:2 injectComponentsRecursively @ VM201 WAService.js:2 va @ VM201 WAService.js:2 create @ VM201 WAService.js:2 sr @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 pr @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 K.emit @ VM201 WAService.js:2 emit @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 K.emit @ VM201 WAService.js:2 emit @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 c @ VM8 asdebug.js:1 u @ VM8 asdebug.js:1 (anonymous) @ VM8 asdebug.js:1 f @ VM8 asdebug.js:1 g @ VM8 asdebug.js:1 (anonymous) @ VM8 asdebug.js:1 _ws.onmessage @ VM8 asdebug.js:1 error (async) (anonymous) @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 (anonymous) @ VM201 WAService.js:2 Show 5 more frames
2021-11-27 - 数组command $.in 第二个参数提示不是数组是哪里出错了?
云数据库存在以下数据: {"_id":"apple-1","category":"fruit","name":"apple","price":10.0,"cost":-22.0,"arrSupplier":["刘一","陈二","张三"],"proterties":{"content1":"string1","key":"key1","number1":1.0},"arrayObject":[{"objString":"objString1","objNumber":11.0},{"objNumber":12.0,"objString":"objString2"},{"objNumber":13.0,"objString":"objString3"}]} {"_id":"orange-1","name":"orange","price":15.0,"category":"fruit","cost":-12.0,"arrSupplier":["张三","王五","赵六"],"properies":{"number1":12.0,"content1":"string2","key":"key2","array1":["array-2",12.0]},"arrayObject":[{"objectNumber":21.0,"objectString":"objectString21"},{"objectString":"objectString22","objectNumber":22.0}]} 测试代码: db.collection('test').aggregate().project({ var_arrSupplier:$.in(['张三','$arrSupplier']) }).end() 错误提示: Error: FailedOperation, (Location40081) $in requires an array as a second argument, found: missing (9d088be4-734b-48ca-81cc-69bed569587f) 求助: 是我哪里做错了?$.in的第二个参数确实是数组啊. 请大家帮我一下.谢谢.
2021-11-21