问题:iOS不识别2020-02-03日期格式,只识别2020.02.03
解决:可以使用dayjs进行兼容
问题:iOS不识别0.5px
解决:可以直接使用1px
小程序的this.setData()
Page(
{
data:{
text:''
},
function()
{
this.text = '使用this赋值,可以赋值成功,但是不会更新到视图'
this.setData({
text:'使用this.setData可以更新到视图'
})
}
}
)
wx.switchTab
{
"pages":[
"pages/index/index",
"pages/detail/detail",
"pages/my/my"
],
"tabBar":{
"list":[
{
"pagePath":"pages/index/index",
"text":"首页"
},
{
"pagePath":"pages/my/my",
"text":"我的"
}
]
}
}
由于switchTab用于tabBar页面跳转,跳转的时候只会关闭其他所有非tabBar页面,所以当使用switchTab从我的页面(pages/my/my)跳转到首页(pages/index/index)时我的页面(pages/my/my)并不会被关闭,再次进入我的(pages/my/my)页面时是不会走onLoad的。
如果是从详情页(pages/detail/detail)跳转到首页(pages/index/index)时详情页会被关闭,再次进入详情页会走onLoad
scroll-view
可滚动视图区域。使用竖向滚动时,需要给scroll-view一个固定高度 ,通过wxss设置height。组件属性的长度单位默认为px。使用scroll-view可以实现数据在特定的区域滚动
可以根据官方文档配置下拉刷新,上拉加载更多,
<wxc-loadmore wx:if="{{upLoading}}" text="努力加载中..." icon="{{true}}"/>
<scroll-view scroll-y="true" style="height:{{height}}px;" wx:if="{{allList && allList.length > 0 && !upLoading}}" bindscrolltolower="loadMoreAll"
bindrefresherrefresh="getInspectionList" refresher-enabled>
<goods-card wx:for="{{allList}}" wx:for-item="listItem" wx:for-index="parentIndex" wx:key="unique" item="{{listItem}}"
tabIndex="{{tabIndex}}" showBtn="{{true}}" catch:uploadImg="handleToUploadImg" catch:editImg="handleToEditImg"
lazyLoad="{{true}}" bind:toDetail="handleToDetail"
>
</goods-card>
<wxc-loadmore wx:if="{{downLoading}}" text="加载中..." icon="{{true}}"/>
<wxc-loadmore wx:if="{{allList.length > 0 && !hasMore}}" is-end="{{true}}" text="到底啦~"/>
</scroll-view>