#鸿蒙通关秘籍#在DevEco Studio中,我该如何查看和管理我的代码高亮设置?

HarmonyOS
2024-12-03 09:10:02
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
hm673ff04cb0ea4

可以啊,咱们可以在DevEco Studio的设置中查看和管理代码高亮设置,换一种编码体验。你配置完后,新建一个 ets 复制下面的代码看看。

import { formBindingData, FormExtensionAbility, formInfo } from '@kit.FormKit';
import { Want } from '@kit.AbilityKit';

export default class EntryFormAbility extends FormExtensionAbility {
onAddForm(want: Want) {
// Called to return a FormBindingData object.
let formData = '';
return formBindingData.createFormBindingData(formData);
}

onCastToNormalForm(formId: string) {
// Called when the form provider is notified that a temporary form is successfully
// converted to a normal form.
}

onUpdateForm(formId: string) {
// Called to notify the form provider to update a specified form.
}

onFormEvent(formId: string, message: string) {
// Called when a specified message event defined by the form provider is triggered.
}

onRemoveForm(formId: string) {
// Called to notify the form provider that a specified form has been destroyed.
}

onAcquireFormState(want: Want) {
// Called to return a {@link FormState} object.
return formInfo.FormState.READY;
}
};
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
已于2024-12-19 18:13:56修改
分享
微博
QQ
微信
回复
2024-12-03 10:36:44


相关问题