2
Hello, I’m beginner in Vue I’m wanting to make a menu with submenu coming from a json, follow the codes I made:
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
{{ response.data.IFs }}
</div>
</template>
<script>
export default {
name: 'app',
data: function() {
return {
response: null
}
},
created() {
this.$http.get("/db").then(response => (this.response = response))
}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
and the json I made:
{
"IFs": [
{
"name": "IFSC",
"url": "HGJJHHGJHG"
},
{
"name": "IFRS",
"url": "DSASADDSA"
}
],
"Cidades": [
{
"name": "paulo",
"url": "dfkjslkfds"
},
{
"name": "Lopes",
"url": "dsfdsfds"
}
]
}
the idea would be for Ifs to be the title of the menu and your children to be part of the submenu and then click on them goes to the link of each one.
Could someone give me a north how to do? Hug.
Can you show how you imagine html? or better explain the menu structure you thought...
– Sergio