提交 01dfdb2d 编写于 作者: Z zhaolinglan

fix compile err

Signed-off-by: Nzhaolinglan <zhaolinglan@huawei.com>
上级 df6d4baa
...@@ -10,7 +10,7 @@ InputMethodExtensionAbility模块,提供生态输入法应用开发者通过In ...@@ -10,7 +10,7 @@ InputMethodExtensionAbility模块,提供生态输入法应用开发者通过In
## 导入模块 ## 导入模块
``` ```
import InputMethodExtension from '@ohos.inputmethodextensionability'; import InputMethodExtensionAbility from '@ohos.inputmethodextensionability';
``` ```
## 属性 ## 属性
......
...@@ -94,7 +94,7 @@ switchInputMethod(target: InputMethodProperty, callback: AsyncCallback&lt;boolea ...@@ -94,7 +94,7 @@ switchInputMethod(target: InputMethodProperty, callback: AsyncCallback&lt;boolea
**示例:** **示例:**
```js ```js
inputmethod.switchInputMethod({packageName:"com.example.kikakeyboard", methodId:"com.example.kikakeyboard"} ,(err,result) => { inputMethod.switchInputMethod({packageName:"com.example.kikakeyboard", methodId:"com.example.kikakeyboard"} ,(err,result) => {
if (err == undefined) { if (err == undefined) {
console.info("switchInputMethod callback result---err: " + err.msg); console.info("switchInputMethod callback result---err: " + err.msg);
return; return;
...@@ -162,16 +162,12 @@ stopInput(callback: AsyncCallback&lt;boolean&gt;): void ...@@ -162,16 +162,12 @@ stopInput(callback: AsyncCallback&lt;boolean&gt;): void
**示例:** **示例:**
```js ```js
InputMethodController.stopInput((err, result) => { InputMethodController.stopInput((error, data) => {
if (err == undefined) { if (error) {
console.error("stopInput callback result---err: " + err.msg); console.error(`failed to stopInput because: ` + JSON.stringify(error));
return; return;
} }
if (result) { console.info(`success stopInput: ` + JSON.stringify(data));
console.info("Success to stopInput.(callback)");
} else {
console.info("Failed to stopInput.(callback)");
}
}); });
``` ```
...@@ -330,10 +326,10 @@ listInputMethod(callback: AsyncCallback&lt;Array&lt;InputMethodProperty&gt;&gt;) ...@@ -330,10 +326,10 @@ listInputMethod(callback: AsyncCallback&lt;Array&lt;InputMethodProperty&gt;&gt;)
```js ```js
InputMethodSetting.listInputMethod((err,data) => { InputMethodSetting.listInputMethod((err,data) => {
if (err == undefined) { if (err == undefined) {
console.error("listInputMethod callback result---err: " + err.msg); console.error("fail to listInputMethod because: " + JSON.stringify(err));
return; return;
} }
console.info("listInputMethod callback result---data: " + JSON.stringify(data)); Array<InputMethodProperty> imeListStr = JSON.stringify(data);
}); });
``` ```
...@@ -381,10 +377,10 @@ displayOptionalInputMethod(callback: AsyncCallback&lt;void&gt;): void ...@@ -381,10 +377,10 @@ displayOptionalInputMethod(callback: AsyncCallback&lt;void&gt;): void
```js ```js
InputMethodSetting.displayOptionalInputMethod((err) => { InputMethodSetting.displayOptionalInputMethod((err) => {
if (err == undefined) { if (err == undefined) {
console.error("displayOptionalInputMethod callback---err: " + err.msg); console.error("failed to displayOptionalInputMethod because: " + JSON.stringify(err));
return; return;
} }
console.info("displayOptionalInputMethod callback"); console.info("success displayOptionalInputMethod");
}); });
``` ```
...@@ -409,7 +405,7 @@ async function InputMethod() { ...@@ -409,7 +405,7 @@ async function InputMethod() {
await InputMethodSetting.displayOptionalInputMethod().then(()=>{ await InputMethodSetting.displayOptionalInputMethod().then(()=>{
console.info("displayOptionalInputMethod promise"); console.info("displayOptionalInputMethod promise");
}).catch((err) => { }).catch((err) => {
console.info("listInputMethod promise err: " + err.msg); console.info("displayOptionalInputMethod promise err: " + err.msg);
}); });
} }
``` ```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册