Created
April 5, 2020 16:55
-
-
Save mercs600/af10e24196452a1e0c621d6e2518d305 to your computer and use it in GitHub Desktop.
nuxt-exercise-6-display-menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="container"> | |
<div class="menu"> | |
<nuxt-link | |
v-for="({link, label}, key) in menu" | |
:key="key" | |
:to="link"> {{ label }} </nuxt-link> | |
</div> | |
<nuxt | |
:keep-alive-props="{ max: 10 }" | |
keep-alive /> | |
</div> | |
</template> | |
<script> | |
export default { | |
data () { | |
return { | |
menu: [] | |
} | |
}, | |
fetch() { | |
this.menu = this.$nuxt.context.store.state.menu | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment