中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
如何获取FormExtensionContext?
微信扫码分享
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; } }