feat: 添加WordExcel预览示例

This commit is contained in:
xiaoxian521
2024-03-23 15:28:42 +08:00
parent 51ef3647fc
commit 4f44f72a2c
8 changed files with 105 additions and 0 deletions

27
src/views/able/excels.vue Normal file
View File

@@ -0,0 +1,27 @@
<script setup lang="ts">
import "@vue-office/excel/lib/index.css";
import VueOfficeExcel from "@vue-office/excel";
defineOptions({
name: "Excels"
});
const excel = "https://xiaoxian521.github.io/hyperlink/other/excel.xlsx";
function renderedHandler() {
console.log("渲染完成");
}
function errorHandler() {
console.log("渲染失败");
}
</script>
<template>
<vue-office-excel
:src="excel"
style="height: 100vh"
@rendered="renderedHandler"
@error="errorHandler"
/>
</template>

18
src/views/able/word.vue Normal file
View File

@@ -0,0 +1,18 @@
<script setup lang="ts">
import "@vue-office/docx/lib/index.css";
import VueOfficeDocx from "@vue-office/docx";
defineOptions({
name: "Word"
});
const docx = "https://xiaoxian521.github.io/hyperlink/other/word.docx";
function rendered() {
console.log("渲染完成");
}
</script>
<template>
<vue-office-docx :src="docx" @rendered="rendered" />
</template>