提交 35209b30 编写于 作者: W wangkailong

fixed b203e63c from https://gitee.com/wkljy/docs/pulls/17346

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