提交 e62f1e81 编写于 作者: R renjiecui

add change log

Signed-off-by: Nrenjiecui <cuirenjie@huawei.com>
上级 0572b041
......@@ -3,6 +3,9 @@
OpenHarmony 3.2.10.1(Mr)版本相较于OpenHarmony 3.2.beta4版本,分布式数据管理子系统的API变更如下
## cl.distributeddatamgr.1 接口变更
**变更影响**
影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。
**关键的接口/组件变更**
......@@ -12,4 +15,46 @@ OpenHarmony 3.2.10.1(Mr)版本相较于OpenHarmony 3.2.beta4版本,分布式
| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig, callback: AsyncCallback\<KVManager\>): void; | 更改前 |
| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): KVManager; | 更改后 |
\ No newline at end of file
**适配指导**
应用中调用createKVManager创建KVManager对象实例可参考下列代码
Stage模型下的示例:
```js
import AbilityStage from '@ohos.application.Ability'
let kvManager;
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.log("MyAbilityStage onCreate")
let context = this.context
const kvManagerConfig = {
context: context,
bundleName: 'com.example.datamanagertest',
}
try {
kvManager = distributedKVStore.createKVManager(kvManagerConfig);
} catch (e) {
console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`);
}
}
}
```
FA模型下的示例:
```js
import featureAbility from '@ohos.ability.featureAbility'
let kvManager;
let context = featureAbility.getContext()
const kvManagerConfig = {
context: context,
bundleName: 'com.example.datamanagertest',
}
try {
kvManager = distributedKVStore.createKVManager(kvManagerConfig);
} catch (e) {
console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`);
}
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册