From 600d18d04133a12c6379ee906161dc7d96501df5 Mon Sep 17 00:00:00 2001 From: PaDaBoo Date: Fri, 4 Mar 2022 14:33:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9await=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=AD=97=E7=9A=84=E7=A4=BA=E4=BE=8B=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: PaDaBoo --- .../reference/apis/js-apis-data-preferences.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md b/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md index 36fe951e6c..88849e6776 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md +++ b/zh-cn/application-dev/reference/apis/js-apis-data-preferences.md @@ -43,7 +43,7 @@ getPreferences(context: Context, name: string, callback: AsyncCallback<Prefer ``` import Ability from '@ohos.application.Ability' import data_Preferences from '@ohos.data.preferences' - var path = await this.context.getDataBaseDir() + var path = this.context.getDataBaseDir() data_Preferences.getPreferences(this.context, 'mystore', function (err, preferences) { if (err) { console.info("Get the preferences failed, path: " + path + '/mystore') @@ -78,7 +78,7 @@ getPreferences(context: Context, name: string): Promise<Preferences> ``` import Ability from '@ohos.application.Ability' import data_Preferences from '@ohos.data.preferences' - var path = await this.context.getDataBaseDir() + var path = this.context.getDataBaseDir() let promise = data_Preferences.getPreferences(this.context, 'mystore') promise.then((preferences) => { preferences.putSync('startup', 'auto') -- GitLab