我异步获得响应后如何更改文本?
var swText = "<h3>Importiranje kvota, molimo sačekajte...</h3>";
swal({ html: swText });
swal.showLoading();
this.koloService.importExcelFileWithOdds(this.brojKola, fileList)
.subscribe(
data => { swText = "<h3>Importiranje završeno!</h3>"; swal.hideLoading(); },
error => { swText = "<h3>Importiranje završeno!</h3>"; swal.hideLoading(); });
答案 0 :(得分:0)
有各种各样的getter用于访问SweetAlert2的不同部分:https://sweetalert2.github.io/#methods
您正在寻找LambdaMetafactory
或更好的swal.getContent()
:
swal.getTitle()
swal('After mignight I will turn into a pumpkin')
swal.showLoading()
// change the title after 2 seconds
setTimeout(() => {
swal.getTitle().textContent = 'I am a pumpkin now!'
swal.hideLoading()
}, 2000)