1.this.setData is not a function
在微信小程序中我们一般通过以下方式来修改data中的数据
|
|
this.setData is not a function
|
|
var that=this;123`success`中使用
that.setData({
imageUrl:imageUrlStr
})
|
|
去微信小程序后台-设置-开发设置-服务器域名
配置request合法域名
这样就可以正常使用了
```
3.css中无法读取本地资源
.wxss
中使用background-image属性不能加载本地资源,在电脑模拟器上显示正常,在真机上不显示
解决方法:
1.使用网络资源
background-image: url(http://xxx.com/icon-arrowdown.png);
2.
无法解决问题
(在电脑模拟器上显示正常,在真机上不显示)(在.wxml
中使用加载本地资源,<view class="with_arrow" style='background-image: url(/resource/meList/icon_arrow_r.png);'>
)- 3.使用base64转码(图片路径会很长很长)
- 4.使用image标签代替背景图片