8***@qq.com
8***@qq.com
  • 发布:2019-07-10 00:01
  • 更新:2019-07-10 00:21
  • 阅读:2073

uni-app uni.navigateTo打开新窗口时组件引用出错

分类:uni-app

父组件main.vue,子组件swiper.vue 两个组件为同级目录。

父组件代码

<template>  
        <view class="swiper-wrap">  
            <swiper-index ref="swiperindex"></swiper-index>  
        </view>  
</template>  
<script>  
    import swiperindex from '@/pages/main/swiper.vue';  
        export default {  
             components:{  
                'swiper-index':swiperindex,  
             },  
       }  
</script>  
<style>  
</style>

子组件代码

<template>  
    <view class="swiper">swiper组件</view>  
</template>  

<script>  
</script>  
<style>  
</style>

当我父组件使用uni.navigateTo({url:"../../pages/main"})打开。报以下错误

Component is not found in path "pages/game/swiper" (using by "pages/game/main");onAppRoute

请问哪里出了问题,谢谢大佬们。

2019-07-10 00:01 负责人:无 分享
已邀请:
8***@qq.com

8***@qq.com (作者)

把原 app删除,重新运行到真机好像可以了。

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