naithein
naithein
NNuxt
Created by naithein on 4/4/2024 in #❓・help
routes
Hi guys. Super new to nuxt. I've got the following route appearing when I console.log(router.options.routes), but all attempts to navigate it return me to the default "/" page. Also noticing that the
{
"name": "news",
"path": "/news",
"meta": {},
"alias": []
}
{
"name": "news",
"path": "/news",
"meta": {},
"alias": []
}
index.vue:
<template>
<Carousel @navigate="navigate"> </Carousel>
</template>
<script setup>

const navigate = () => {
return navigateTo({ path: '/news' });
};
</script>
<template>
<Carousel @navigate="navigate"> </Carousel>
</template>
<script setup>

const navigate = () => {
return navigateTo({ path: '/news' });
};
</script>
news.vue
<template>
<div>placeholder page</div>
</template>
<template>
<div>placeholder page</div>
</template>
Been reading https://nuxt.com/docs/getting-started/routing and i can't seem to find what I'm missing. Can anyone point me in the right direction?
10 replies