javascript - Regarding vue life cycle issues, how to obtain rendered elements
怪我咯
怪我咯 2017-05-19 10:32:34
0
1
511

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.

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
Ty80

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(()=>{
        //
    })
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template