#鸿蒙学习大百科#如何获取FormExtensionContext?

如何获取FormExtensionContext?

HarmonyOS
2024-10-22 13:34:36
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
风间爱小新V
import { formBindingData, FormExtensionAbility } from "@kit.FormKit";
import Want from "@ohos.app.ability.Want";

export default class MyFormExtensionAbility extends FormExtensionAbility {
  onAddForm(want: Want): formBindingData.FormBindingData {
    //获取FormExtensionContext
    let formExtensionContext = this.context
    let dataObj1: Record<string, string> = {
      'temperature': '11c',
      'time': '11:00'
    };
    let obj1: formBindingData.FormBindingData = formBindingData.createFormBindingData(dataObj1);
    return obj1;
  }
}
分享
微博
QQ
微信
回复
2024-10-22 22:03:49
相关问题
#鸿蒙学习大百科#ArkTS如何生成xml?
302浏览 • 1回复 待解决