When VUEJS receives the value from the server, it assigns a value to the array.

the data received on the server is [{"name": "TOM", "age": "16"}, {"name": "JACK", "age": "18"}, {"name": "marry", "age": "20"}]
I think there is something wrong with the loop code in html.

<ul v-for="item in items">
<li>{{ item.name }}</li>
<li>{{ item.age }}</li>
</ul>
export default {
    data () {
      return {
        header:"",
        items: [
          {
            name:"",
            age:""
          }
        ]
      }
    },
    methods:{
      postdata(){
        var user_id = this.getcookies("user_id");
        this.$http.post("http://example.com/user",{
            userID:user_id
        }).then(function(data){
            this.items=data.body.data
        }
        )
      }
    }
  }
Feb.26,2021

< li VFF = "v in items" >

{{v.name}}

{{v.age}}


there is no problem with the loop. This.items got it wrong. It belongs to the this pointing problem, and you didn't succeed in assigning the value.

this.$http.post('http://example.com/user',{
            userID:user_id
        }).then((data)=>{//
            this.items=data.body.data//thisVue
        }
        )

should be the this pointing problem, var self = this;


this scope problem. Then ((res) = > {}) write

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bd2965-30e06.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bd2965-30e06.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?