我正在将项目转换为Typescript.我遇到了toastr的问题.
import {toastr} from "toastr";
Run Code Online (Sandbox Code Playgroud)
我用Nuget下载了typescript定义文件并将其包含在项目中.
它在文件末尾有这个导出:
declare var toastr: Toastr;
declare module "toastr" {
export = toastr;
}
Run Code Online (Sandbox Code Playgroud)
但是,我得到编译时错误: Modle "toastr" has no exported member 'toastr'
我该如何解决这个问题?
Dav*_*ret 13
请尝试以下方法:
import * as toastr from "toastr";
Run Code Online (Sandbox Code Playgroud)
这样做会导入整个模块toastr.
| 归档时间: |
|
| 查看次数: |
4315 次 |
| 最近记录: |