In Vue, loop an array, do not display the problem, get a fake data, it will loop out instead? Why

Source: Internet
Author: User

Core: On the issue of this point, it is best to print out this to see

You can render that array on the page.

<div>{{listData}}</div>
You'll see something magical, even time and space.
Solution:
GetList () {
Let _this=this
Let params={
Currentpage:_this.currentpage,
Pagesize:_this.pagesize,
}
_this.ajax ({
Type: "Post",
Data:params,
URL: "/author/fans/fanstimelist",
Success (RES) {
_this.listdata=res.responsebody.data
Console.log (_this.listdata, ' data printing ')
Console.log (_this, ' data printing ')
}

The best solution when using the arrow function. has been changed to an arrow function

 

GetList () {
Let params={
CurrentPage:this.currentPage,
PageSize:this.pageSize,
}
This.ajax ({
Type: "Post",
Data:params,
URL: "/author/fans/fanstimelist",
Success: (res) + = {
This.listdata=res.responsebody.data
Console.log (this.listdata, ' data printing ')
Console.log (this, ' Data printing ')
}
});
},

In Vue, loop an array, do not display the problem, get a fake data, it will loop out instead? Why

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.