'Sweetalert2 imageUrl isn't showing
My problem is that I tried both iconHtml and imageUrl and none of them is working for my unless I am using an url. However, in the documentation it says "Should contain a string with the path or URL to the image.". May be I'm doing something wrong? I tried full path, relative path, I tried importing and setting imported item for the path but nothing works unless I use an url. Any ideas from anybody who has been using swal2?
Store.swal.fire({
titleText: 'some text',
imageUrl: './icon.svg',
imageWidth: 64,
imageHeight: 64,
confirmButtonText: 'Ок',
customClass: {
confirmButton: 'swal-confirm-btn'
}
});}
Solution 1:[1]
U can try this one, give full path of the image where you have stored, in my case assets/images/imagename.png or any other format.
Swal.fire({
type: 'success',
title: 'God Job...!!',
text: 'successfully created!',
imageUrl: '/assets/images/tick-circle.svg',
})
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Varsha-Nagle |
