【发布时间】:2018-12-03 18:43:15
【问题描述】:
我正在学习 NativeScript 并尝试在他们的 Playground 中学习一些教程,他们正在使用 lodash。根据 NativeScripts 的博客,您应该能够使用下拉菜单在 Playground 中使用 lodash 模块。 (https://www.nativescript.org/blog/nativescript-playground-is-on-fire)
这可行,并且 lodash 文件夹已添加到 app 文件夹中。当我尝试导入它时会出现问题。它说找不到lodash。我试过了:
import * as _ from 'lodash';
import _ from 'lodash';
var _ = require ('lodash');
还有许多其他建议,但这些似乎都不起作用。我已经尝试添加 @types(NativeScript 说它们会自动添加),但即使添加了 @types/lodash 也会失败。
有人知道如何在 NativeScript 操场上进行这项工作吗?谢谢。
【问题讨论】:
标签: javascript lodash nativescript angular2-nativescript