当我试图包含“应用程序设置模块”时,我得到了一个错误。
*找不到模块‘应用程序-设置’<-错误
错误出现在我的storage.driver.ts中,这是在nativescript中,它是使用环回sdk构建器构建的。
storage.driver.ts
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);
}
}
}我该怎么办才能解决这个问题呢?我是新来的本地人。
发布于 2019-04-20 10:45:28
这就是您导入它的方式。
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'https://stackoverflow.com/questions/41032988
复制相似问题