Home

Issue: 1116

Nuxt-view with nuxt-link

[issue link]

The problem that im facing has to do with nuxt-link and nuxt-view. As far as i’ve used vuejs i remember that if you put router-link and down below you put a router-view it will render everything with navigation bar if its there. However with nuxt i put nuxt-link (or router-link for testing) and below i put nuxt-view (or router-view for testing) it redirects me to another page but the navigation bar dissapears. At first i was told that i might need to use layout instead of components but its pretty much the same result. Here is the code:

 <template>
   <div id="">
     <nuxt-link :to='{name: "terms-sections-test1"}'>Go to 1 </nuxt-link>
     <nuxt-link to='/terms/sections/test2'>Go to 2 </nuxt-link>
     <router-link to='terms/sections/test1'>ROUTER LINK</router-link>


     <nuxt-view> </nuxt-view>
     <router-view ></router-view>



   </div>
 </template>
 <script>
 export default {
 /* eslint-disable */
   layout: 'navigation'

 }
 </script>
 <style lang="css" scoped>
 </style>

Is there a work around so that i dont have to include layout everytime in its children components? or i need to include them everywhere? sorry for the noob question but i cant really see good documentation for nuxt-view.

P.S: everytime when i press on my first nuxt-link it redirects me to the page but when i go back to initial page (the code above) it gives me this warning:

    [Vue warn]: Unknown custom element: <nuxt-view> - did you register the component correctly? For 
     recursive components, make sure to provide the "name" option.

Please help 😃

This question is available on Nuxt.js community (#c977)