Static GitHub Issues

[1132] extendRoutes doesn't work?

prev: Fetch and AsyncData not working on reloading page.
next: How to use postcss and postcss-cssnext with scss files ?

nuxt.config.js: router: { extendRoutes(routes) { routes: [{ path: '/', redirect: '/lines' }] } }

index.vue:

<template>
  <div>
    <ul class="m-tag">
      <nuxt-link :to="item.link" v-for="item in navList" :key="item.title" active-class="act">
        {{ item.title }}
      </nuxt-link>
    </ul>
    <nuxt-child/>
  </div>
</template>

<script>

export default {
  head () {
    return {
      meta: [
        { hid: 'description', name: 'description', content: 'My custom description' }
      ]
    }
  },
  data () {
    return {
      navList: [{
        title: 'lines',
        link: '/lines'
      }, {
        title: 'traffic',
        link: '/traffic'
      }]
    }
  }
}
</script>

image

when I visit "http://127.0.0.1:3000",I expect "http://127.0.0.1:3000/lines"

but it doesn't work.

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c997">#c997</a>)</em></sub></div>