// 配置路径的地方
{
"pages": [
{
"path": "pages/index/index",
"style": {
"enablePullDownRefresh": true
}
}
]
}
// pages/index/index.vue
export default {
data: {
// ...省略此处代码
},
onLoad() {
// ...省略此处代码
},
onPullDownRefresh() {
console.log('用户执行了下拉操作...')
},
methods: {
// ...省略此处代码
}
}
// pages/index/index.vue
export default {
data: {
// ...省略此处代码
},
onLoad() {
// ...省略此处代码
},
async onPullDownRefresh() {
await this.getSwiperList();
await this.getCategoryList();
await this.getFloorList();
// 停止下拉交互
uni.stopPullDownRefresh;
},
methods: {
async getSwiperList() {},
async getCategoryList() {},
async getFloorList() {}
}
}