赞
踩
普通页面跳转到 带有tabBar页面的时候不能使用 wx.navigateTo()
小程序中跳转到选项卡页面使用 wx.switchTab()
跳转
onReachBottom()
函数 ,, 在下拉刷新显示取消loading :
wx.showNavigationBarLoading()
wx.hideNavigationBarLoading()
需要在json中配置 “enablePullDownRefresh” 为 true
下拉刷新 onPullDownRefresh()
,控制下拉刷新:
wx.startPullDownRefresh()
wx.stopPullDownRefresh()
.container::before{
content:"",
witdh:200rpx
}
子组件绑定一个事件,触发父组件的另一个事件
this.triggerEvent()
父组件设置这个事件,并接收参数:
传递的参数在 event.details
中
aspectFill 被裁切,保持图片不变形
<image class="head-img" src="{{movie.images.large}}" mode="aspectFill"/>
wx.previewImage()
wx.previewImage({
urls: [this.data.movie.images.large],
})
scroll-view 是 微信小程序中一个可滚动视图容器组件,,支持水平和垂直滚动,
flex设置不缩放: flex-shrink:0
<scroll-view scroll-x="{{true}}" enable-flex="{{true}}" class="img-container">
<block wx:for="{{5}}">
<image src="https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2519542323.jpg" mode=""/>
</block>
</scroll-view>
.img-container{
margin-top: 100rpx;
display: flex;
height: 500rpx;
}
.img-container image{
width: 300rpx;
margin: 20rpx;
flex-shrink: 0;
}
-webkit-filter: blur(20px)
是一种 CSS3 中的滤镜效果,用于对元素进行高斯模糊处理。
.head-img{
width: 100%;
height: 320rpx;
-webkit-filter: blur(20px);
}
// 不要换行
white-space: nowrap;
// 文本内容超出容器宽度时,被阶段并且显示省略号
text-overflow: ellipsis;
overflow:hidden;
小程序直接在自定义组件上设置class 可能会不生效,需要设置外部样式
externalClass
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。