【问题标题】:How to use Swal in Angular project?如何在 Angular 项目中使用 Swal?
【发布时间】:2018-11-07 03:01:01
【问题描述】:

嗯,我有一个 Angular 项目,想在上面使用 swal2,但我不知道如何集成它。

请帮忙。

【问题讨论】:

    标签: angular sweetalert sweetalert2


    【解决方案1】:

    需要用命令安装,

    npm install --save sweetalert
    

    然后在组件中,

    import swal from 'sweetalert';
    

    把它当做,

     swal({
          content: component.location.nativeElement
        }).then(() => {
          component.destroy();
        });
    

    STACKBLITZ DEMO

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 2022-12-01
      • 2018-12-20
      • 2016-10-28
      • 1970-01-01
      • 2022-08-14
      • 1970-01-01
      相关资源
      最近更新 更多