提交 faedae42 编写于 作者: H Hollokin

【输入法框架】示例代码整改

Signed-off-by: NHollokin <taoyuxin2@huawei.com>
上级 1a4f4a76
...@@ -552,7 +552,7 @@ stopInputSession(callback: AsyncCallback&lt;boolean&gt;): void ...@@ -552,7 +552,7 @@ stopInputSession(callback: AsyncCallback&lt;boolean&gt;): void
```js ```js
try { try {
InputMethodController.stopInputSession((error, result) => { inputMethodController.stopInputSession((error, result) => {
if (error) { if (error) {
console.error('stopInputSession err: ' + JSON.stringify(error)); console.error('stopInputSession err: ' + JSON.stringify(error));
return; return;
...@@ -595,7 +595,7 @@ stopInputSession(): Promise&lt;boolean&gt; ...@@ -595,7 +595,7 @@ stopInputSession(): Promise&lt;boolean&gt;
```js ```js
try { try {
InputMethodController.stopInputSession().then((result) => { inputMethodController.stopInputSession().then((result) => {
if (result) { if (result) {
console.info('Success to stopInputSession.'); console.info('Success to stopInputSession.');
} else { } else {
...@@ -637,7 +637,7 @@ showSoftKeyboard(callback: AsyncCallback&lt;void&gt;): void ...@@ -637,7 +637,7 @@ showSoftKeyboard(callback: AsyncCallback&lt;void&gt;): void
**示例:** **示例:**
```js ```js
InputMethodController.showSoftKeyboard((err) => { inputMethodController.showSoftKeyboard((err) => {
if (err === undefined) { if (err === undefined) {
console.info('showSoftKeyboard success'); console.info('showSoftKeyboard success');
} else { } else {
...@@ -674,7 +674,7 @@ showSoftKeyboard(): Promise&lt;void&gt; ...@@ -674,7 +674,7 @@ showSoftKeyboard(): Promise&lt;void&gt;
**示例:** **示例:**
```js ```js
InputMethodController.showSoftKeyboard().then(async (err) => { inputMethodController.showSoftKeyboard().then(async (err) => {
console.log('showSoftKeyboard success'); console.log('showSoftKeyboard success');
}).catch((err) => { }).catch((err) => {
console.error('showSoftKeyboard err: ' + JSON.stringify(err)); console.error('showSoftKeyboard err: ' + JSON.stringify(err));
...@@ -709,7 +709,7 @@ hideSoftKeyboard(callback: AsyncCallback&lt;void&gt;): void ...@@ -709,7 +709,7 @@ hideSoftKeyboard(callback: AsyncCallback&lt;void&gt;): void
**示例:** **示例:**
```js ```js
InputMethodController.hideSoftKeyboard((err) => { inputMethodController.hideSoftKeyboard((err) => {
if (err === undefined) { if (err === undefined) {
console.info('hideSoftKeyboard success'); console.info('hideSoftKeyboard success');
} else { } else {
...@@ -746,7 +746,7 @@ hideSoftKeyboard(): Promise&lt;void&gt; ...@@ -746,7 +746,7 @@ hideSoftKeyboard(): Promise&lt;void&gt;
**示例:** **示例:**
```js ```js
InputMethodController.hideSoftKeyboard().then(async (err) => { inputMethodController.hideSoftKeyboard().then(async (err) => {
console.log('hideSoftKeyboard success'); console.log('hideSoftKeyboard success');
}).catch((err) => { }).catch((err) => {
console.error('hideSoftKeyboard err: ' + JSON.stringify(err)); console.error('hideSoftKeyboard err: ' + JSON.stringify(err));
...@@ -774,7 +774,7 @@ stopInput(callback: AsyncCallback&lt;boolean&gt;): void ...@@ -774,7 +774,7 @@ stopInput(callback: AsyncCallback&lt;boolean&gt;): void
**示例:** **示例:**
```js ```js
InputMethodController.stopInput((error, result) => { inputMethodController.stopInput((error, result) => {
if (error) { if (error) {
console.error('failed to stopInput because: ' + JSON.stringify(error)); console.error('failed to stopInput because: ' + JSON.stringify(error));
return; return;
...@@ -808,7 +808,7 @@ stopInput(): Promise&lt;boolean&gt; ...@@ -808,7 +808,7 @@ stopInput(): Promise&lt;boolean&gt;
**示例:** **示例:**
```js ```js
InputMethodController.stopInput().then((result) => { inputMethodController.stopInput().then((result) => {
if (result) { if (result) {
console.info('Success to stopInput.'); console.info('Success to stopInput.');
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册