- 拖动slider为0时,在form中submit后value=""?
<form bindsubmit="formSubmit" bindreset="formReset"> <slider name="slider" show-value min="-1" max="10" value="1" ></slider> <view class="btn-area"> <button formType="submit">Submit</button> <button formType="reset">Reset</button> </view> </form> formSubmit: function (e) { console.log('form发生了submit事件,携带数据为:', e.detail.value) }, formReset: function () { console.log('form发生了reset事件') }, slider 拖动到1时,正常,form发生了submit事件,携带数据为: {slider: 1} slider 拖动到0时,就出现slider为空!!!! index.js? [sm]:8 form发生了submit事件,携带数据为: {slider: ""}
2020-04-01 - slider在form中的BUG,拖到0时,form对应的value为空?
slider在form中的BUG,拖到0时,form对应的value为空 这个BUG什么时候解决?
2020-04-01 - 能否在开发者工具的调试栏目中,让开发者看到globalData的值?
开发中,只能通过console.log查看globalData的值,非常不方便,建议在调试窗口,可看globalData数据!
2019-11-14 - 云函数访问MYSQL数据库出错?
// 云函数入口文件 const cloud = require('wx-server-sdk') const mysql=require('mysql2/promise') cloud.init() // 云函数入口函数 exports.main = async (event, context) => { const connection=await mysql.createConnection({ host:'mysql57.rdsmj85epr606zi.rds.bj.baidubce.com', user:'sam', database:'samMYSQL', password:'xxxxxxxx', }) const [rows, fields] = await connection.execute('SELECT version();') return rows } 错误如下: WAService.js:1 Uncaught (in promise) Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID 8a0ca2a7-f0f0-11e9-af3a-525400192d0e, cloud function service error code -504002, error message Cannot read property 'execute' of undefined; at cloud.callFunction api; at new u (WAService.js:1) at d (WAService.js:1) at f (WAService.js:1) at Function.success (WAService.js:1) at WAService.js:1 at C (WAService.js:1) at i.<anonymous> (WAService.js:1) at i.emit (WAService.js:1) at Rs (WAService.js:1) at WAService.js:1
2019-10-17 - 调用wx.setScreenBrightness,设置屏幕亮度,用IPHONE X真机调试有问题?
var screenbright=0.5 getScreenBrightness:function(){ wx.getScreenBrightness({ success(res){ console.log("screenbrightness",res) screenbrightness:res.value } }) }, /**setScreenBrightness * 真机测试不稳定 */ setScreenBrightness:function(){ var temp=screenbrightness+0.1 screenbrightness=temp wx.setScreenBrightness({ value: (temp>1?1:temp), success(res){ console.log("setScreenBrightness",res) } }) }, screenbrightness {value: 0.25147944688796997, errMsg: "getScreenBrightness:ok"} index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"} index.js:14 screenbrightness {value: 0.6000000238418579, errMsg: "getScreenBrightness:ok"} index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"} index.js:14 screenbrightness {value: 0.699999988079071, errMsg: "getScreenBrightness:ok"} index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"} index.js:14 screenbrightness {value: 0.800000011920929, errMsg: "getScreenBrightness:ok"} index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"} index.js:14 screenbrightness {value: 0.8999999761581421, errMsg: "getScreenBrightness:ok"} index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"} index.js:14 screenbrightness {value: 1, errMsg: "getScreenBrightness:ok"} index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"} index.js:14 screenbrightness {value: 1, errMsg: "getScreenBrightness:ok"} index.js:14 screenbrightness {value: 0.2415519505739212, errMsg: "getScreenBrightness:ok"} index.js:28 setScreenBrightness {errMsg: "setScreenBrightness:ok"} index.js:14 screenbrightness {value: 0.2415519505739212, errMsg: "getScreenBrightness:ok"}
2019-10-05