<template>
<view class="content">
<view v-for="(item,index) in msg" :key="index">
{{item.data.content.data.description}}
</view>
</view>
</template>
<script>
export default {
onLoad() {
this.requestData(10);
},
onPullDownRefresh() {
this.requestData(12);
},
data() {
return {
msg: []
}
},
methods: {
requestData(number) {
uni.request({
url: 'https://api.apiopen.top/videoCategoryDetails',
method: 'GET',
data: {
id: number
},
header: {
'custom-header': 'hello' //自定义请求头信息
},
success: (res) => {
this.msg = res.data.result;
}
});
}
}
}
</script>
<style scoped lang="scss">
.content {}
</style>
uni-app下拉刷新
最新推荐文章于 2024-08-22 11:53:20 发布