mc.openDocument(Object object)
新开页面打开文档。
Object object 参数
属性 | 类型 | 默认值 | 必填 | 说明 | 最低版本 |
---|---|---|---|---|---|
filePath | String | 是 | 文件路径 (本地路径) | ||
showMenu | Boolean | false | 否 | 是否显示右上角菜单(iOS有效) | |
fileType | String | 否 | 文件类型,指定文件类型打开文件 | ||
success | Function | 否 | 接口调用成功的回调函数 | ||
fail | Function | 否 | 接口调用失败的回调函数 | ||
complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
Object.fileType 的合法值
值 | 说明 | 最低版本 |
---|---|---|
doc | doc 格式 | |
docx | docx 格式 | |
xls | xls 格式 | |
xlsx | xlsx 格式 | |
ppt | ppt 格式 | |
pptx | pptx 格式 | |
pdf 格式 |
示例代码:
mc.openDocument({
filePath: '../test.pdf'
})