v-for to create menu (q-side-link item)
-
Can we not do this?
<div v-for=“page in pages” v-bind:key =“page.key”>
<q-side-link item to={{page.path}} exact>
<q-item-main label>{{page.name}}</q-item-main>
</q-side-link>
</div>I can’t seem to get the page value to use it on the to=.
I’m probably not doing the key right. -
@helpmelearn Vue 2.x doesn’t allow interpolations inside props/attributes. You should use
v-bind:to="page.path"
or shorthand:to="page.path"
. -
hi .im having almost the same problem
<q-item-main v-for=“link in links” v-bind:key=“link.x” v-bind:to=“link.url” exact>{{ link.title }}</q-item-main>
the link is not clickable.pls help
-
a jsfiddle exampl with quasar layout and vue-router:
https://jsfiddle.net/ypL7nLrh/30/ -
thanks! . it works fine now