P
P
pingo2018-07-16 09:12:39
Vue.js
pingo, 2018-07-16 09:12:39

Dynamic nav from an array of objects how to generate?

for example, when going to the /questions route, json arrives from the server:

[
{id : 1, name : 'one',  desc : 'desc one', data: {}},
{id : 2, name : 'two',  desc : 'desc two', data: {}},
{id : 3, name : 'three',  desc : 'desc three', data: {}},
{id : 4, name : 'four',  desc : 'desc four', , data: {}}
]

you need the router to assemble something like this:
<div  v-for="question  in questions">
    <router-link to="{ name: 'question/:id', params: { data: {{ category.id }} }">{{question.name  }}</router-link>
</div>

can wuy router in hash mode like that? who has already tried it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2018-07-16
@pingo

And you read the documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question