[Vuejs]-How to get Data correctly in Vue.js

0👍

Try to put your script tag into body or header tags, see here

It won’t validate outside of the <body> or <head> tags. It also won’t
make much difference — unless you’re doing DOM manipulations that
could break IE before the body element is fully loaded — to putting it
just before the closing </body>.

0👍

You need to return your data:

data() {
  return {
    {
      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"}]

    }
  }
}

Leave a comment