作者:李留白,来自原文地址 官网文档在使用setData()设置数组对象的某个元素的属性时,是这么使用的:
使用了 ‘array[0].text’ : ‘changed data’ 这样的值。但在实际使用中,我们对数组的中的某个元素的设置是动态的。即 我们通常应该是 ‘array[‘+index+’].text’ : ‘changed data’ ,其中index应该是一个动态的数字。但显然,这样是无法使用在对象的key中的。 所以,我只能使用了一个变通的方法。如下:
即提前把对象准备好。 希望以后可以有更好的方法。 二:Error之util.randomString is not a function作者:古加文,来自原文地址 WAService.js:3 thirdScriptError util.randomString is not a function;at “pages/index/index” page lifeCycleMethod onLoad function TypeError: util.randomString is not a function 解决方案: |