未验证 提交 ca97ba6e 编写于 作者: O openharmony_ci 提交者: Gitee

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

Merge pull request !11729 from Hollokin/master
...@@ -552,7 +552,7 @@ stopInputSession(callback: AsyncCallback<boolean>): void ...@@ -552,7 +552,7 @@ stopInputSession(callback: AsyncCallback<boolean>): 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<boolean> ...@@ -595,7 +595,7 @@ stopInputSession(): Promise<boolean>
```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<void>): void ...@@ -637,7 +637,7 @@ showSoftKeyboard(callback: AsyncCallback<void>): 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<void> ...@@ -674,7 +674,7 @@ showSoftKeyboard(): Promise<void>
**示例:** **示例:**
```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<void>): void ...@@ -709,7 +709,7 @@ hideSoftKeyboard(callback: AsyncCallback<void>): 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<void> ...@@ -746,7 +746,7 @@ hideSoftKeyboard(): Promise<void>
**示例:** **示例:**
```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<boolean>): void ...@@ -774,7 +774,7 @@ stopInput(callback: AsyncCallback<boolean>): 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<boolean> ...@@ -808,7 +808,7 @@ stopInput(): Promise<boolean>
**示例:** **示例:**
```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.
先完成此消息的编辑!
想要评论请 注册