提交 72c88a41 编写于 作者: H Hollokin

示例代码缩进2空格;if(err!==undefined)等直接改为if(err)即可

Signed-off-by: NHollokin <taoyuxin2@huawei.com>
上级 2e52d650
......@@ -38,9 +38,9 @@ Extension生命周期回调,在拉起Extension输入法应用时调用,执
```js
class InputMethodExt extends InputMethodExtensionAbility {
onCreate(want) {
console.log('onCreate, want:' + want.abilityName);
}
onCreate(want) {
console.log('onCreate, want:' + want.abilityName);
}
}
```
......@@ -56,8 +56,8 @@ Extension生命周期回调,在销毁输入法应用时回调,执行资源
```js
class InputMethodExt extends InputMethodExtensionAbility {
onDestroy() {
console.log('onDestroy');
}
onDestroy() {
console.log('onDestroy');
}
}
```
......@@ -21,9 +21,9 @@ import InputMethodExtensionContext from '@ohos.InputMethodExtensionContext';
```js
import InputMethodExtensionAbility from '@ohos.InputMethodExtensionAbility';
class EntryAbility extends InputMethodExtensionAbility {
onCreate() {
let context = this.context;
}
onCreate() {
let context = this.context;
}
}
```
......@@ -45,7 +45,7 @@ destroy(callback: AsyncCallback\<void>): void
```js
this.context.destroy((err) => {
console.log('destroy result:' + JSON.stringify(err));
console.log('destroy result:' + JSON.stringify(err));
});
```
......@@ -67,8 +67,8 @@ destroy(): Promise\<void>;
```js
this.context.destroy().then(() => {
console.log('Succeed in destoring context.');
console.log('Succeed in destoring context.');
}).catch((error) => {
console.log('Failed to destory context: ' + JSON.stringify(error));
console.log('Failed to destory context: ' + JSON.stringify(error));
});
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册