el-image dynamic data returns image loading failure problem

Insert picture description here

problem:

Dynamically returned data, the echo image fails to load, and lazy loading does not work, asynchronous loading does not refresh

solve:

Use v-if to render the picture when it exists

		<el-image
            style="width: 100px; height: 100px"
            lazy
            v-if="add_form_dialog.img"
            :src="add_form_dialog.img"
            :preview-src-list="[add_form_dialog.img]"
          >
          </el-image>
          <span v-else>加载中...</span>

Guess you like

Origin blog.csdn.net/weixin_45108907/article/details/113625219