Because I just learned vue and then studied axios by myself, I wanted to write a simple query background data
<tr v-for=" user in uList"> <td>{{}}</td> <td>{{}}</td> <td>{{}}</td> </td> </tr>
Then I wrote such a code
created: function () { ("http://localhost:8080/student/findAll").then(function (response) { = ; (uList); }).catch(function (reason) { }) }
Then the data can be obtained in the background, but it cannot be displayed on the table
I found that although the changed data cannot be displayed on the table
Then I found that this is not an external this object, and then the data is echoed after making changes.
new Vue({ el:'#app', data:{ uList:[], }, created: function () { var arr = this; ("http://localhost:8080/student/findAll").then(function (response) { = ; (uList); }).catch(function (reason) { }) } })
Supplementary knowledge:vue data has a value, but the page {{}} cannot get the value
My problem is that the order of js is introduced is wrong, which causes the value in vue not to be displayed normally
The correct order should be:
First introduce the js of vue --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The above article briefly talks about the pitfalls that cannot be displayed on the table after VUE obtaining background data is all the content I share with you. I hope you can give you a reference and I hope you can support me more.