ITPub博客

首页 > IT职业 > IT图书 > 小程序学习记录 2

小程序学习记录 2

IT图书 作者:ciscoeden 时间:2021-09-09 10:28:47 0 删除 编辑

哈哈哈哈哈哈

1.this 指向问题

图片描述

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

2.swiper 的高度问题

图片描述

图片描述

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 .

        图片描述

        图片描述


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4346/viewspace-2822515/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-12

  • 博文量
    79
  • 访问量
    637