since i moved my navlist to app.component , pages stopped working and nothing happens when i click on them
im trying to learn vue step by step and this happend when i moved ul from body to template
please check app component navbar to template
<body id="body">
<navbarr
:pages="pages"
:active-page="activePage"
></navbarr>
<page-viewer
:page="pages[activePage]"></page-viewer>
app.component('navbarr',{
computed:{
navbarClasses(){
return{
'bg-light':!this.darkNav,
'bg-dark':this.darkNav
}
}
},
props:['pages','activePage'],
template: <ul class="nav" :class="navbarClasses"> <form class="d-flex"> <div class="form-check form-switch"> <input class="form-check-input" @click="darkNav=!darkNav" type="checkbox" role="switch" id="flexSwitchCheckDefault" > </div> </form> <li v-for="(page,index) in pages"class="nav-item" :key="index"> <a class="nav-link" :href="page.link.url" :class="{active:activePage==index}" :title="\
This goes to ${page.link.text} page`"
@click.prevent="activePage=index"
>{{page.link.text}}</a>
</li>
</ul>
`,
data(){
return{
darkNav:false,
}
}
})