vue demo avoid readAsBinaryString [ci skip]

This commit is contained in:
Jimmy Wärting 2021-09-19 06:11:54 +02:00
parent 18ce6212c4
commit bca646a1ad
2 changed files with 5 additions and 4 deletions

@ -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);
}
}
};