如何在aurelia中使用已安装的模块
我正在使用skeleton typescript示例并完成文档。我正在尝试用数字设置一个值转换器,如图所示 我已经通过如何在aurelia中使用已安装的模块,aurelia,Aurelia,我正在使用skeleton typescript示例并完成文档。我正在尝试用数字设置一个值转换器,如图所示 我已经通过jspm安装numeric安装了numeric。它是在jspm依赖项中添加的package.json,我手动将其添加到bundles.js中 保存typescript文件后,我收到错误:找不到模块“numeric”。。我缺少什么?您应该在配置中添加它,如: export function configure(aurelia) { aurelia.use .
jspm安装numeric
安装了numeric。它是在jspm依赖项中添加的package.json,我手动将其添加到bundles.js中
保存typescript文件后,我收到错误:
找不到模块“numeric”。
。我缺少什么?您应该在配置中添加它,如:
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('numeral');
aurelia.start().then(() => aurelia.setRoot());
}
您将在package.json中找到确切的包名:
jspm": {
"dependencies": {
...
"numeral": "xxxx"
...
}
}
对于numeric.js,您需要d.T。由于打字没有d.T,这可以解决问题:
$ jspm install npm:@types/numeral.
它在我的框架中与值转换器一起工作。导入可以像从“数字”中导入*为数字一样进行
Import*
我已经添加了插件调用,并再次检查package.json是否将“numeric”:“npm:numeric@^1.5.3”列为jspm依赖项。错误“找不到模块‘numeric’仍然存在。”VsCode还抱怨找不到模块numeric。您应该能够在通过jspm安装后导入它。也许代码中的某个地方有错误
$ jspm install npm:@types/numeral.