项目地址:https://github.com/adriancooney/console.image
在个人实际使用中,某些分辨率的图片使用console.image会导致显示2遍的原因,记录一下解决方法。
console.image.js中约第167行
color: transparent;
后添加
background-repeat: no-repeat;
即可解决图片重复问题。
直接生成可使用代码:
新增一行
console.log('console.log("%c ","'+dim.style + "background: url(" + url + "); background-size: " + (this.width * scale) + "px " + (this.height * scale) + "px; color: transparent; background-repeat: no-repeat;"+'");')
即可输出直接复制可用的代码。
此处生成的代码为上方修改过重复显示问题的代码