diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmethod-subtype.md b/zh-cn/application-dev/reference/apis/js-apis-inputmethod-subtype.md index d3c7dc85ce834a9f260efcae4a569666fc59cac5..540351cd5980a02023d85e7a9ab163748f4572d4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmethod-subtype.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmethod-subtype.md @@ -21,7 +21,7 @@ import InputMethodSubtype from '@ohos.InputMethodSubtype'; | 名称 | 类型 | 可读 | 可写 | 必选 | 说明 | | -------- | -------- | -------- | -------- | -------- | -------- | | label | string | 是 | 否 | 否 | 输入法子类型的标签。 | -| name | string | 是 | 否 | 是 | 输入法子类型的名字。 | +| name | string | 是 | 否 | 是 | 输入法内部名称。 | | id | string | 是 | 否 | 是 | 输入法子类型的id。 | | mode | string | 是 | 否 | 否 | 输入法子类型的模式,包括upper(大写)和lower(小写)。 | | locale | string | 是 | 否 | 是 | 输入法子类型的方言版本。 | 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 892b9a2b98717c5ec5e2e8f787bd79619e563f22..e1b4c44893f56ce9965efc8f948cf0a1b849237c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md @@ -256,9 +256,9 @@ switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallb ```js try { inputMethod.switchCurrentInputMethodSubtype({ - id: "com.example.kikakeyboard", - label: "ServiceExtAbility", - name: "", + id: "ServiceExtAbility", + label: "", + name: "com.example.kikakeyboard", mode: "upper", locale: "", language: "", @@ -317,9 +317,9 @@ switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise<boolean& ```js try { inputMethod.switchCurrentInputMethodSubtype({ - id: "com.example.kikakeyboard", - label: "ServiceExtAbility", - name: "", + id: "ServiceExtAbility", + label: "", + name: "com.example.kikakeyboard", mode: "upper", locale: "", language: "", @@ -391,25 +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: "com.example.kikakeyboard", - label: "ServiceExtAbility", - name: "", - mode: "upper", - 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; @@ -461,25 +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: im.packageName, - label: im.methodId, - name: "", - mode: "upper", - locale: "", - language: "", - icon: "", - iconId: 0, - extra: {} - }).then((result) => { + inputMethod.switchCurrentInputMethodAndSubtype(im, imSubType).then((result) => { if (result) { console.info('Succeeded in switching currentInputMethodAndSubtype.'); } else {