“删除”我使用进口{存储}从“@离子/存储”存储运行时错误无法读取属性未定义
给运行时错误无法读取属性未定义时使用“删除” this.storage.remove( '钥匙');
这是我的功能代码是我过去:this.storage.remove
logout(): void {
this.storage.remove(this.HAS_LOGGED_IN);
this.storage.remove('email');
this.events.publish('user:logout');
};
存储在哪里定义? – devqon
是否将@ ionic/storage添加到app.module.ts? –
yes storage.set()和storage.get()工作正常 – moreshwar