vuejs用window.open打开base64图片
// 预览
export function winOpenFile(fileName, content) {
if (imgReg(fileName)) {
// 验证是否为图片
const img = new Image();
img.src = content; //base64图片链接
const newWin = window.open("", "_blank");
newWin.document.write(img.outerHTML);
newWin.document.title = fileName
newWin.document.close();
} else {
window.open(content, "_blank");
}
}
以上是编程学习网小编为您介绍的“vuejs用window.open打开base64图片”的全面内容,想了解更多关于 vuejs 内容,请继续关注编程基础学习网。