t***@gmail.com
t***@gmail.com
  • 发布:2019-03-28 12:11
  • 更新:2019-03-28 15:34
  • 阅读:936

为什么APP请求不到数据 网页的可以

分类:uni-app
<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>  
2019-03-28 12:11 负责人:无 分享
已邀请:
DCloud_UNI_HT

DCloud_UNI_HT

看具体报错信息。

  • t***@gmail.com (作者)

    PC端没报错. 真机运行请求不到

    2019-03-28 18:20

该问题目前已经被锁定, 无法添加新回复