Html:
<img id="num" :src="src"/>
JS
getImg() {
let that = this;
that.src = 'http://localhost:8080/user/getImage?time=' + Date.now();
}
后面加上一个时间戳防止浏览器开缓存认为是同一个url而不进行访问
方法二:
<img src="/getCaptcha" onclick="this.src=this.src+'?'+Math.random()">