继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

小程序学习记录 2

红书包
关注TA
已关注
手记 9
粉丝 7
获赞 72

哈哈哈哈哈哈

1.this 指向问题

https://img3.mukewang.com/5c7365e40001c61609930673.jpg

一大早上就要被这个搞得晕。要定义到回调函数的外面。

2.swiper 的高度问题

https://img1.mukewang.com/5c7366c30001b0de10620127.jpg

https://img3.mukewang.com/5c7366ee0001694504330406.jpg

swiper 的高度需要获取屏幕高度再重新赋值。不然撑不开页面。我用了我认为最简单的方法,网上也还有其他的方法。

<swiper current="{{currentTab}}" duration="200" bindchange="swiperChange" 
    style="height:{{clineheight?clineheight+'px':'auto'}}">
</swiper>
data: {
    currentTab:0,
    clineheight:''
    },
/**  * 生命周期函数--监听页面加载  */
onLoad: function (options) {
this.getheight();
},
getheight:function(){
  const that=this;
  wx.getSystemInfo({
  success: function (res) {
  that.setData({
      clineheight: res.windowHeight
      })
    },
   })
  },


3.如何禁用右上角三点转发分享?

在该对应js页面中删除   onShareAppMessage


4.scroll-view根据索引不跳转的问题

        没有好好看文档,看实例。是需要赋值id,而不是自定义data-id .

        https://img1.mukewang.com/5ca1792200012aa510280476.jpg

        https://img1.mukewang.com/5ca179b700015e3904510176.jpg


打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP