一、格式化文件1、把创建小程序时默认的页面代码清除2、示例文件每个文件都要清除成这样的空白文件index.wxml <view>首页</view>index.wxss 完全清除index.js Page({
data: {
},
onLoad() {
},
onPullDownRefresh: function () { // 下拉刷新
var page = getCurrentPages().pop(); // 得到这个页面对象
page.onLoad(); // 调用页面的onLoad()方法进行刷新页面
wx.stopPullDownRefresh() // 刷新成功后停止下拉刷新
},
})
阿里矢量图:https://www.iconfont.cn/home/index?spm=a313x.7781069.1998910419.2app.json {
"pages":[
"pages/index/index",
"pages/logs/logs",
"pages/home/home"
],
"window":{
"backgroundTextStyle":"light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle":"black",
"enablePullDownRefresh": true,
"backgroundColor": "#e3e3e3"
},
"tabBar": {
"color": "#a9b7b7",
"selectedColor": "#11cd6e",
"borderStyle": "black",
"list":[
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "/image/jf.png",
"selectedIconPath": "/image/jf1.png"
},
{
"pagePath": "pages/logs/logs",
"text": "任务",
"iconPath": "/image/ly.png",
"selectedIconPath": "/image/ly1.png"
},
{
"pagePath": "pages/home/home",
"text": "我的",
"iconPath": "/image/wd.png",
"selectedIconPath": "/image/wd1.png"
}
]
}
}
配套视频: 02页面初始化及底部导航的编写