NuxtN
Nuxt2y ago
naithein

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": []
}

index.vue:
<template>
  <Carousel @navigate="navigate"> </Carousel>
</template>
<script setup>

  const navigate = () => {
    return navigateTo({ path: '/news' });
  };
</script>

news.vue
<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?
Nuxt
Nuxt file-system routing creates a route for every file in the pages/ directory.
Was this page helpful?