mirror of
https://github.com/501351981/vue-office.git
synced 2025-07-15 07:32:19 +08:00
13 lines
280 B
JavaScript
13 lines
280 B
JavaScript
export function getData(src, options={}) {
|
|
if (typeof src === 'string') {
|
|
return fetchExcel(src, options)
|
|
}
|
|
return Promise.resolve(src)
|
|
}
|
|
|
|
function fetchExcel(src, options) {
|
|
return fetch(src, options).then(res=>{
|
|
return res.arrayBuffer()
|
|
})
|
|
}
|