From 364aa5c35fc03098a462e8f72127aff7dc8a4009 Mon Sep 17 00:00:00 2001 From: cy7717 Date: Mon, 20 Mar 2023 21:28:12 +0800 Subject: [PATCH] mod Signed-off-by: cy7717 --- .../reference/apis/js-apis-inputmethod.md | 38 +------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md b/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md index a164e9c18c..5384b8a12f 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md @@ -391,26 +391,9 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp ```js let im = inputMethod.getCurrentInputMethod(); -let inputMethodProperty = { - packageName: im.packageName, - methodId: im.methodId, - name: im.packageName, - id: im.methodId, - extra: {} -} let imSubType = inputMethod.getCurrentInputMethodSubtype(); try { - inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, { - id: "imSubType.id", - label: "", - name: "imSubType.name", - mode: "", - locale: "", - language: "", - icon: "", - iconId: 0, - extra: {} - }, (err,result) => { + inputMethod.switchCurrentInputMethodAndSubtype(im, imSubType, (err,result) => { if (err !== undefined) { console.error('Failed to switchCurrentInputMethodAndSubtype: ' + JSON.stringify(err)); return; @@ -462,26 +445,9 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp ```js let im = inputMethod.getCurrentInputMethod(); -let inputMethodProperty = { - packageName: im.packageName, - methodId: im.methodId, - name: im.packageName, - id: im.methodId, - extra: {} -} let imSubType = inputMethod.getCurrentInputMethodSubtype(); try { - inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, { - id: imSubType.id, - label: "", - name: imSubType.name, - mode: "", - locale: "", - language: "", - icon: "", - iconId: 0, - extra: {} - }).then((result) => { + inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, imSubType).then((result) => { if (result) { console.info('Succeeded in switching currentInputMethodAndSubtype.'); } else { -- GitLab