未验证 提交 7970313a 编写于 作者: O openharmony_ci 提交者: Gitee

!17347 FormBindingData相关描述更新(Release)

Merge pull request !17347 from wangkailong/cherry-pick-1681741531
...@@ -48,20 +48,17 @@ createFormBindingData(obj?: Object | string): FormBindingData ...@@ -48,20 +48,17 @@ createFormBindingData(obj?: Object | string): FormBindingData
**示例:** **示例:**
```ts ```ts
import featureAbility from '@ohos.ability.featureAbility'; import formBindingData from '@ohos.app.form.formBindingData';
import fileio from '@ohos.fileio'; import fs from '@ohos.file.fs';
let context=featureAbility.getContext();
context.getOrCreateLocalDir((err,data)=>{ try {
let path=data+'/xxx.jpg'; let fd = fs.openSync('/path/to/form.png');
let fd = fileio.openSync(path);
let obj = { let obj = {
'temperature': '21°', 'temperature': '21°',
'formImages': {'image': fd} 'formImages': { 'image': fd }
}; };
try { formBindingData.createFormBindingData(obj);
formBindingData.createFormBindingData(obj); } catch (error) {
} catch (error) { console.error(`catch error, code: ${error.code}, message: ${error.message}`);
console.log(`catch err->${JSON.stringify(err)}`); }
}
})
``` ```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册