我正在尝试在我的Angular项目中使用SweetAlert。
这是我如何使用SweetAlert:
import swal from 'sweetalert';
swal({
title: "Problem",
text: "Try again later!",
icon: "error"
})
我遇到了以下错误:
有人能帮我解决这个问题吗?ERROR in node_modules/sweetalert/typings/sweetalert.d.ts(4,9): error TS2403: 后续变量声明必须具有相同的类型。变量'swal'的类型必须为“typeof import("C:/Users/user/Desktop/University/Thesis/workspace/web/myProject/project/node_modules/sweetalert/typings/sweetalert")”,但此处的类型为“SweetAlert”。