wx小程序入门&坑

时间:2023-03-10 01:56:41
wx小程序入门&坑

1、腾讯云的nodejs版服务代码,在本地用吹cnpm install安装依赖之后,初始化数据库不成功:

  换成npm install 并 npm run initdb 之后 可以了。。。。

2、屏蔽页面的上下拉刷新:

  page的json配置中:

  

{
"disableScroll": true
}

3、上下滑动一定要用  scroll-view 组件哦! 不然页面滑动没有加速效果。

4、scroll-view 中包含的 view 的margin-bottom 不起效:

  增加一个空view,设置它的高度占位。

5、没有 requestAnimationFrame 方法

6、 Page data 中不能放 自定义类型的对象   5555 ...  会报错

7、 添加 scroll-view 并设置高度, 消除ios下 上下拉留白问题。

  

<scroll-view scroll-y style="height:{{wh}}px;" >
页面布局
</scroll-view>
onload () {
wx.getSystemInfo({
success: function (res) {
that.setData({
"wh": res.windowHeight
})
}
}) }