提交 f0be3312 编写于 作者: inkwalk's avatar inkwalk

feat(App): openDocument

上级 1871a3ec
import {
API_OPEN_DOCUMENT,
API_TYPE_OPEN_DOCUMENT,
defineAsyncApi,
OpenDocumentProtocol,
OpenDocumentOptions,
} from '@dcloudio/uni-api'
import { getRealPath } from '@dcloudio/uni-platform'
export const openDocument = defineAsyncApi<API_TYPE_OPEN_DOCUMENT>(
API_OPEN_DOCUMENT,
({ filePath, fileType }, { resolve, reject }) => {
plus.io.resolveLocalFileSystemURL(
getRealPath(filePath),
(entry) => {
plus.runtime.openFile(getRealPath(filePath))
resolve()
},
(err) => {
reject('openDocument:fail ' + err.message)
}
)
},
OpenDocumentProtocol,
OpenDocumentOptions
)
export * from './storage/storage'
export * from './file/getFileInfo'
export * from './file/openDocument'
export * from './device/compass'
export * from './device/vibrate'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册