This commit is contained in:
SheetJS 2024-06-02 20:40:13 -04:00
parent 14c13c9fdc
commit 0d6edbdc86

@ -1,8 +1,20 @@
<script setup lang="ts">
// @ts-ignore
import html from '../../data/pres.xlsx?html';
import b64 from '../../data/pres.xlsx?b64';
import { read, utils } from "xlsx";
/* parse workbook and convert first sheet to row array */
const wb = read(b64);
const ws = wb.Sheets[wb.SheetNames[0]];
interface IPresident { Name: string; Index: number; };
const data = utils.sheet_to_json<IPresident>(ws);
</script>
<template>
<div v-html="html"></div>
<table>
<tr><th>Name</th><th>Index</th></tr>
<tr v-for="(row,R) in data" v-bind:key="R">
<td>{{row.Name}}</td>
<td>{{row.Index}}</td>
</tr>
</table>
</template>