父组件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
请问哪里出了问题,谢谢大佬们。
1 个回复
8***@qq.com (作者)
把原 app删除,重新运行到真机好像可以了。