首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到模块“应用程序-设置”

找不到模块“应用程序-设置”
EN

Stack Overflow用户
提问于 2016-12-08 06:18:01
回答 1查看 3.2K关注 0票数 5

当我试图包含“应用程序设置模块”时,我得到了一个错误。

*找不到模块‘应用程序-设置’<-错误

错误出现在我的storage.driver.ts中,这是在nativescript中,它是使用环回sdk构建器构建的。

storage.driver.ts

代码语言:javascript
复制
import * as AppSettings from 'application-settings'; <---- Error here
export class StorageDriver {
static set(key: string, value: any) {
AppSettings.setString(key, String(value));
}
static get(key: string): any {
return AppSettings.getString(key);
}
static remove(key: string): any {
if (AppSettings.hasKey(key)) {
  AppSettings.remove(key);
} else {
  console.log('Trying to remove unexisting key: ', key);
}
}
}

我该怎么办才能解决这个问题呢?我是新来的本地人。

EN

回答 1

Stack Overflow用户

发布于 2019-04-20 10:45:28

这就是您导入它的方式。

代码语言:javascript
复制
const applicationSettings = require('tns-core-modules/application-settings')

// or if you are using webpack for example
import * as applicationSettings from 'tns-core-modules/application-settings'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41032988

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档