A
A
andreyAmaterasu2020-07-22 16:42:57
Vue.js
andreyAmaterasu, 2020-07-22 16:42:57

How to iterate over Set values ​​in Vue.js?

I need to create a list with unique values, for this I create a Set object, but I can't iterate over the values ​​of this object in "v-for", if I just pass it to html {{ setObject }}, the result will be like on the screenshot . (If you also pass an array, the result will be something like this: ['item1, 'item2', ...]). Is it possible to use a Set in Vue.js, if so, how can I iterate over its values?5f184260aea95059356576.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Gololobov, 2020-07-22
@andreyAmaterasu

Actually the same as the object through of

<div v-for="(item, index) of mySet" :key=index>{{ item }}</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question