未验证 提交 939bb9d7 编写于 作者: 葛亚芳 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-data-preferences.md.

Signed-off-by: N@ge-yafang <geyafang@huawei.com>
上级 5e4504d2
......@@ -405,13 +405,13 @@ has(key: string, callback: AsyncCallback&lt;boolean&gt;): void
```js
preferences.has('startup', function (err, isExist) {
if (err) {
console.info("Failed to check the key of 'startup'. Cause: " + err);
console.info("Failed to check the key 'startup'. Cause: " + err);
return;
}
if (isExist) {
console.info("The key of 'startup' is contained.");
console.info("The key 'startup' is contained.");
} else {
console.info("The key of 'startup' dose not contain.");
console.info("The key 'startup' dose not contain.");
}
})
```
......@@ -626,7 +626,7 @@ data_preferences.getPreferences(this.context, 'mystore', function (err, preferen
return;
}
var observer = function (key) {
console.info("The key of " + key + " changed.");
console.info("The key " + key + " changed.");
}
preferences.on('change', observer);
preferences.put('startup', 'auto', function (err) {
......@@ -670,7 +670,7 @@ data_preferences.getPreferences(this.context, 'mystore', function (err, preferen
return;
}
var observer = function (key) {
console.info("The key of " + key + " changed.");
console.info("The key " + key + " changed.");
}
preferences.on('change', observer);
preferences.put('startup', 'auto', function (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册