Skip to content

Commit

Permalink
增加excel
Browse files Browse the repository at this point in the history
  • Loading branch information
biancangming committed Mar 15, 2024
1 parent 666a066 commit 4aac775
Show file tree
Hide file tree
Showing 13 changed files with 5,099 additions and 6 deletions.
3 changes: 2 additions & 1 deletion example/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'

export {}

Expand Down Expand Up @@ -44,7 +45,7 @@ declare module '@vue/runtime-core' {
ATimeRangePicker: typeof import('ant-design-vue/es')['TimeRangePicker']
ATreeSelect: typeof import('ant-design-vue/es')['TreeSelect']
AUpload: typeof import('ant-design-vue/es')['Upload']
CodeView: typeof import("./src/components/CodeView")['default']
CodeView: typeof import('./src/components/CodeView.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
Expand Down
8 changes: 8 additions & 0 deletions example/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ const router = createRouter({
title: "jsPDF",
}
},
{
path: '/xlsx',
name: 'xlsx',
component: () => import("../views/xlsxView/index.vue"),
meta: {
title: "xlsx",
}
},
{
path: '/crudAntd',
name: 'crudAntd',
Expand Down
4 changes: 4 additions & 0 deletions example/src/router/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const menus: Menu[] = [
title: "jsPDF",
routerName: "jsPDF"
},
{
title: "xlsx",
routerName: "xlsx"
},
]
},
{
Expand Down
4 changes: 3 additions & 1 deletion example/src/views/pdfjsView/demo/useHtmlAsImage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import { useHtmlAsImage, useHtmlAsPdf } from "howuse/pdf";
const fileArea = ref();
const fileArea2 = ref();
const { downloadImg, loading: loadingImg } = useHtmlAsImage({
// saveCanvasBlob 保存为一个blob流,Promise对象。 0.0.5-beta.2 以上版本
const { downloadImg, saveCanvasBlob, loading: loadingImg } = useHtmlAsImage({
ref: fileArea,
fileName: "雨巷.png",
});
Expand Down
1 change: 1 addition & 0 deletions example/src/views/xlsxView/demo/xlsxImport/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@[js](./src/views/echartsView/demo/BarEchart/index.vue)
14 changes: 14 additions & 0 deletions example/src/views/xlsxView/demo/xlsxImport/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<template>
<div>
<button @click="importExcel()">加载excel</button>
</div>
</template>
<script lang="ts" setup>
import { xlsxFileToJson } from "howuse/xlsx";
import { loadLocalFile } from "howtools"
function importExcel() {
loadLocalFile().then(files => {
xlsxFileToJson(files[0]).then(console.log)
})
}
</script>
12 changes: 12 additions & 0 deletions example/src/views/xlsxView/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<CodeView title="自适应折线图,其它自适应类似">
<XlsxImportDemo />
<template #code>
<XlsxImportCode />
</template>
</CodeView>
</template>
<script setup lang="ts">
import XlsxImportDemo from "./demo/xlsxImport/index.vue";
import XlsxImportCode from "./demo/xlsxImport/index.md";
</script>
Loading

0 comments on commit 4aac775

Please sign in to comment.