Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swal显示加载属性HTML_Html_Angular_Sweetalert2_Angular8 - Fatal编程技术网

Swal显示加载属性HTML

Swal显示加载属性HTML,html,angular,sweetalert2,angular8,Html,Angular,Sweetalert2,Angular8,我使用SWAL2(Sweet Alert2)来显示一个警报,我想显示一个加载进度微调器,但是对于html,没有文档只显示一个加载微调器。有一个属性showLoaderOnConfirm,它在单击确认按钮后显示加载微调器。我只想在显示警报时显示加载微调器,并通过html实现 当您单击“查找”时,会发生如下情况: 权力 测试连接 使用.TS,我可以做到: async testConnection(): Promise<void> { Swal.fire({ t

我使用SWAL2(Sweet Alert2)来显示一个警报,我想显示一个加载进度微调器,但是对于html,没有文档只显示一个加载微调器。有一个属性
showLoaderOnConfirm
,它在单击确认按钮后显示加载微调器。我只想在显示警报时显示加载微调器,并通过html实现

当您单击“查找”时,会发生如下情况:


权力
测试连接
使用.TS,我可以做到:

  async testConnection(): Promise<void> {
    Swal.fire({
      title: 'Auto close alert!',
      timer: 3000,
      onBeforeOpen: () => {
        Swal.showLoading()
      }
    })
  }
async testConnection():Promise{
喷火({
标题:“自动关闭警报!”,
计时器:3000,
onBeforeOpen:()=>{
Swal.showLoading()
}
})
}

文档:

您可以使用sweet alert中提供的html描述,并在其中显示加载gif

Swal.fire({
  title: 'Auto close alert!',
  timer: 3000,
  html:
    '<img src="https://media.giphy.com/media/xTk9ZvMnbIiIew7IpW/giphy.gif">'
  })
Swal.fire({
标题:“自动关闭警报!”,
计时器:3000,
html:
''
})

这不是我想要的:-(这与您使用html显示加载程序的描述相匹配。您必须编辑您的问题,以便更清楚地了解您需要什么。
Swal.fire({
  title: 'Auto close alert!',
  timer: 3000,
  html:
    '<img src="https://media.giphy.com/media/xTk9ZvMnbIiIew7IpW/giphy.gif">'
  })