gin-vue-admin/web/src/components/office/docx.vue

32 lines
587 B
Vue
Raw Normal View History

2023-09-22 02:47:16 +00:00
<template>
<vue-office-docx :src="docx" @rendered="rendered" />
2023-09-22 02:47:16 +00:00
</template>
<script>
export default {
name: 'Docx'
}
2023-09-22 02:47:16 +00:00
</script>
<script setup>
import { ref, watch } from 'vue'
2023-09-22 02:47:16 +00:00
// 引入VueOfficeDocx组件
import VueOfficeDocx from '@vue-office/docx'
// 引入相关样式
import '@vue-office/docx/lib/index.css'
2023-09-22 02:47:16 +00:00
const model = defineModel({
type: String
})
2024-03-13 07:17:57 +00:00
const docx = ref(null)
watch(
() => model,
(value) => {
docx.value = value
},
{ immediate: true }
)
const rendered = () => {}
2023-09-22 02:47:16 +00:00
</script>
<style lang="scss" scoped></style>