Execution method after vue list rendering

as shown in figure

  • vue
  • watch,this.$nextTickdom




that is to say, the callback function of this.$nextTick does not execute the method after the end of list rendering. What is the situation?

Feb.27,2021

nextTick is to perform a deferred callback after the end of the next DOM update cycle. Use this method immediately after modifying the data to get the updated DOM. " It is difficult to guarantee that the next Dom update after the imageList change is the one rendered by the picture, which is not necessarily accurate. It is recommended to control the display through rendering, not through Dom operation

. < hr >

comment is not easy to post code

let img = new Image();
img.src = t.employeeItem.employeePic;
img.onload = function(){
    Vue.nextTick(() => {
    // do something
    }
}

1. Make sure that after the imageList change, your watch has executed
2.dom to update the picture and may not have finished loading
3. Add printing to nextTick to see if

has been executed.
Menu