Requirements: Get a set of data through axios and display it in the form of a set of <li>
. You need to get the actual size of each <li>
and then calculate it further. Adjust the style of these <li>
.
In beforeMount
I use axios to get the data, but in mounted
I use $nextTick
and still cannot get the rendered $el
, please tell me how to obtain the rendered group <li>
? Thanks.
PHP中文网2017-05-19 10:34:34
updated?
Or, you watch the data variable and then nextTick
data(){
return {list:[]}
},
mounted(){
axios.post().then((json) => {
this.list = json.list
})
},
watch(val){
this.nextTick(()=>{
//
})
}