<template>
<view class="home">
<home-header></home-header>
<home-swiper :list="swiperList"></home-swiper>
<home-icon :list="iconList"></home-icon>
<home-middle></home-middle>
<home-hot :list="hotImg"></home-hot>
<!-- <view class="">{{ title }}</view> -->
</view>
</template>
<script>
import HomeHeader from '../../components/Home/HomeHeader.vue';
import HomeSwiper from '../../components/Home/HomeSwiper.vue';
import HomeIcon from '../../components/Home/HomeIcon.vue'
import HomeMiddle from '../../components/Home/HomeMiddle.vue'
import HomeHot from '../../components/Home/HomeHot.vue'
export default {
data() {
return {
title: 'hello',
iconList: [],
swiperList: [],
hotImg: []
};
},
components: {
HomeHeader,
HomeSwiper,
HomeIcon,
HomeMiddle,
HomeHot
},
onLoad() {
this.getHomeInfo()
},
methods: {
getHomeInfo () {
const me = this
uni.request({
url: '../../static/mock/index.json',
success(res) {
const data = res.data.data
me.iconList = data.iconList
me.swiperList = data.swiperList
me.hotImg = data.hotImg
}
})
}
}
};
</script>
t***@gmail.com
- 发布:2019-03-28 12:11
- 更新:2019-03-28 15:34
- 阅读:1032
为什么APP请求不到数据 网页的可以
分类:uni-app
t***@gmail.com (作者)
PC端没报错. 真机运行请求不到
2019-03-28 18:20