Answer the question
In order to leave comments, you need to log in
How to add array to data attribute in vue js template?
Hello. I can easily add an array to the data attribute in a php template and get something like this
. And then I can easily get it using $('.class').data('sizes') and use it in js code.
Tell me, how to achieve the same in the vue template, so that there would also be an array in the data attribute? Now I have when adding an array there using
<div class="w-construc Pos(r)" :data-sizes="item.SIZES">
Answer the question
In order to leave comments, you need to log in
JSON.stringify(item.SIZES)
Just don't do it that way. You don't need an array in data
. Whatever you do with this array, you must do it directly within vue.
sitettf.com/fontfiles/a_CampusCaps.php
is very similar
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question