@liuyunxi/office-viewer
v1.0.1
Published
office预览 vue3+ts
Downloads
17
Maintainers
Readme
Office文件预览
代码演示
<template>
<YxOfficeViewer :url="docx">word预览</YxOfficeViewer>
<YxOfficeViewer :url="xls">xls预览</YxOfficeViewer>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const docx = ref(
'https://norisk-prod-1305901002.cos.ap-chengdu.myqcloud.com/20211028/100a84754dd549da8dc6c9f9594a7d57.docx',
)
const xls = ref(
'https://norisk-prod-1305901002.cos.ap-chengdu.myqcloud.com/test/%E7%BA%B3%E6%A0%BC%E5%8F%8C%E9%87%8D%E9%A2%84%E9%98%B2%E6%9C%BA%E5%88%B6%E8%BF%90%E8%A1%8C%E8%AF%84%E5%88%86%E6%A0%87%E5%87%86%20V2.0.xls',
)
</script>
<style scoped lang="less"></style>
API
参数
| 参数 | 说明 | 类型 | 默认值 | |-----|--------------|:------:|-------| | url | 文件地址(公网可以访问) | string | |