Here is my code and I want to get list
array and show them in html
<!DOCTYPE HTML>
<html>
<head>
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app">
<h2>{{number}}</h2>
<h2>Here it is!</h2>
<div v-for="item in list">{{ item.question_text }}</div>
</div>
</body>
<script type="text/javascript">
var app = new Vue({
el: '#app',
data: {
number:0,
list : [{question_text: "apple", question_owner: "HJ", answer_owner: "1Sun"},
{question_text: "banana", question_owner: "HJ", answer_owner: "1Sun"},
{question_text: "caramel", question_owner: "HJ", answer_owner: "1Sun"},
{question_text: "demon", question_owner: "HJ", answer_owner: "1Sun"}]
}
})
</script>
</html>
I think Vue
was recognized rightly but some error happened while getting data, because four div
DOM element was made well. Then, Why couldn't I get data properly??