[Nuxt] Build a Navigation Component in Vue.js and Use in a Nuxt Layout
2017-07-25 20:33
477 查看
You can isolate parts of templates you want to re-use into components, but you can also reuse those components across pages using layouts. This lesson walks you through creation a navigation component then extracting it out into the default layout.
layout/default.vue:
layout/default.vue:
<template> <div> <navigation></navigation> <nuxt/> </div> </template> <script> import navigation from '~components/navigation' export default { components: { navigation } } </script>
相关文章推荐
- [Nuxt] Use Vuex Actions to Delete Data from APIs in Nuxt and Vue.js
- [Nuxt] Navigate with nuxt-link and Customize isClient Behavior in Nuxt and Vue.js
- [Vue] Create Vue.js Layout and Navigation with Nuxt.js
- [Nuxt] Build a Vue.js Form then use Vuex Actions to Post to an API in Nuxt
- [Nuxt] Display Vuex Data Differently in Each Page of Nuxt and Vue.js
- [Nuxt] Add Arrays of Data to the Vuex Store and Display Them in Vue.js Templates
- [Nuxt] Update Vuex State with Mutations and MapMutations in Vue.js
- [Vue] Build Vue.js Apps with the Vue-CLI and Nuxt.js
- vue项目build报错的解决办法(ERROR in static/js/vendor.xxxxx.js from UglifyJs)
- [JS] Use repeat and list directives in AngularJS
- VueJs Install and useg
- How to build & install GLFW 3 and use it in a Linux project
- vue引入组件无法显示且报错[Vue warn]: Do not use built-in or reserved HTML elements as component id: header
- Combining Navigation Drawer with ViewPager and TabLayout in one screen
- vue Do not use built-in or reserved HTML elements as component id: nav
- [Nuxt] Update State with Vuex Actions in Nuxt.js
- Use Storyboards to Build Navigation Controller and Table View
- use noscript html tag when user disable the javascript in browser, guide user how to enable the js in different browser and retu
- wpf - ComponentResourceKey and it use in Author...
- [Vue warn]: Do not use built-in or reserved HTML elements as component id: