2
I’m trying to pass on a textarea
an array of Vue.js, and would like to turn it into json
, what would be the best way to do that?
new Vue({
el:"#app",
data : {
nome_da_variavel_array:
'[{variavel : 'valor'},{variavel : 'valor'},{variavel : 'valor'}]'
}
});
<textarea>{{nome_da_variavel_array}}</textarea>
Is there any code or example of what you want to do? .
– fernandosavio
I edited in question!
– Victor M.
It would be easier to use the method
JSON.stringify
and take a real value and convert to JSON. I will formulate an example answer for you to see how it is.– fernandosavio