forked from sheetjs/sheetjs
vue demo avoid readAsBinaryString [ci skip]
This commit is contained in:
parent
18ce6212c4
commit
bca646a1ad
@ -6,7 +6,8 @@ vue: ## Simple server for vue
|
||||
nuxt: ## nuxt.js demo
|
||||
mkdir -p node_modules
|
||||
cd node_modules; if [ ! -e xlsx ]; then ln -s ../../../ xlsx; fi; cd ..
|
||||
nuxt
|
||||
npm i nuxt vue
|
||||
npx nuxt
|
||||
|
||||
.PHONY: weex
|
||||
weex: ## Build weex project
|
||||
|
@ -74,8 +74,8 @@ export default {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
/* Parse data */
|
||||
const bstr = e.target.result;
|
||||
const wb = XLSX.read(bstr, {type:'binary'});
|
||||
const ab = e.target.result;
|
||||
const wb = XLSX.read(new Uint8Array(ab), {type:'array'});
|
||||
/* Get first worksheet */
|
||||
const wsname = wb.SheetNames[0];
|
||||
const ws = wb.Sheets[wsname];
|
||||
@ -85,7 +85,7 @@ export default {
|
||||
this.data = data;
|
||||
this.cols = make_cols(ws['!ref']);
|
||||
};
|
||||
reader.readAsBinaryString(file);
|
||||
reader.readAsArrayBuffer(file);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user