【发布时间】:2021-01-13 06:18:03
【问题描述】:
我有一个 sweetAlert2 模态,我想在其中使用一个图像,但要么我引用这样的 img src="./assets/img/cry.png" 或 src="../assets/img/cry.png" 它不会显示,但在 vue 的其他部分,这个 src 地址工作正常,我应该如何引用它在 SweetAlert2 中?
this.$swal({
title: '<div style="font-weight:bold;">sorry</div>',
icon: 'error',
confirmButtonText: 'Cool',
position: 'top',
backdrop: false,
html:'<img src="../assets/img/cry.png" style="width:128px;height:128px;">',
})
【问题讨论】:
标签: vue.js sweetalert2