mirror of
https://github.com/501351981/vue-office.git
synced 2025-07-15 07:32:19 +08:00
40 lines
871 B
Vue
40 lines
871 B
Vue
<script setup>
|
|
import VueOfficeDocx from '../../../packages/docx/index';
|
|
import PreviewWrapper from '../common/PreviewWrapper.vue';
|
|
import useLoading from '../hooks/useLoading.js';
|
|
function onRendered(){
|
|
useLoading.hideLoading();
|
|
}
|
|
function onError(e){
|
|
console.log('出差',e);
|
|
useLoading.hideLoading();
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<PreviewWrapper
|
|
accept=".docx"
|
|
placeholder="请输入docx文件地址"
|
|
default-src="https://501351981.github.io/vue-office/examples/dist/static/test-files/test.docx"
|
|
>
|
|
<template v-slot="slotProps">
|
|
<VueOfficeDocx
|
|
:src="slotProps.src"
|
|
style="flex: 1;height: 0"
|
|
@rendered="onRendered"
|
|
@error="onError"
|
|
/>
|
|
</template>
|
|
|
|
</PreviewWrapper>
|
|
|
|
</template>
|
|
|
|
<style scoped>
|
|
.operate-area {
|
|
display: flex;
|
|
margin: 10px;
|
|
align-items: center;
|
|
}
|
|
|
|
</style> |