Apologies for the question that may seem silly.
Here is the code snippet I am currently working with:
var app = new Vue({
el: '#app',
data: {
words: []
},
created() {
let something = document.getElementById('word_data')
if (something) { this.words = something.dataset.content.slice() }
}
})
Now, here is the HTML section:
<input type="hidden" id="word_data" data-content="["one","two","thee"]">
This HTML section represents an array in the format of
["one", "two", "three", "four", "etc"]
.
I am attempting to assign this array to the words
variable in Vue. How can I accomplish this?
If I simply assign it as shown in my example, it treats the whole array as a single record.
I am certain the solution is straightforward. Can you point out what I might be overlooking?