@file-viewer/vue3 3.2.2 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +31 -9
- package/README.md +265 -246
- package/README.zh-CN.md +465 -0
- package/dist/components/export.js +2 -3
- package/dist/components/export2.js +458 -426
- package/dist/components/fit.js +4 -14
- package/dist/components/image.js +130 -66
- package/dist/components/messages.js +1 -2
- package/dist/components/objectSpread2.js +6 -12
- package/dist/components/print-mask.js +1 -2
- package/dist/components/printMask.js +1 -2
- package/dist/index.mjs +1414 -1401
- package/dist/src/package/components/FileViewer/hooks/useViewerSourceLoading.d.ts +2 -1
- package/dist/src/package/components/FileViewer/hooks/useViewerToolbar.d.ts +1 -0
- package/dist/vue3.css +1 -1
- package/package.json +6 -5
package/README.en.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @file-viewer/vue3
|
|
2
2
|
|
|
3
|
+
[English](https://github.com/flyfish-dev/file-viewer/blob/main/packages/components/vue3/README.md) · [简体中文](https://github.com/flyfish-dev/file-viewer/blob/main/packages/components/vue3/README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
Browser-side file preview for Vue 3. Use one component API for loading, search, zoom, page navigation, print and export where supported by the selected format. This is the lightweight package: add renderer presets for PDF, Office and other document formats.
|
|
6
|
+
|
|
3
7
|
<!-- FILE_VIEWER_PACKAGE_HEADER -->
|
|
4
8
|
<p>
|
|
5
9
|
<a href="https://www.npmjs.com/package/@file-viewer/vue3"><img src="https://img.shields.io/npm/v/@file-viewer%2Fvue3?logo=npm" alt="npm version"></a>
|
|
@@ -9,7 +13,7 @@
|
|
|
9
13
|
</p>
|
|
10
14
|
|
|
11
15
|
<p>
|
|
12
|
-
<a href="https://github.com/flyfish-dev/file-viewer">GitHub</a> · <a href="https://doc.file-viewer.app/">Docs</a> · <a href="https://demo.file-viewer.app/">Live demo</a> · <a href="https://doc.file-viewer.app/guide/formats">Format matrix</a> · <a href="https://github.com/flyfish-dev/file-viewer/issues">Issues</a> · <a href="https://github.com/flyfish-dev/file-viewer/blob/main/packages/components/vue3/README.md">简体中文</a>
|
|
16
|
+
<a href="https://github.com/flyfish-dev/file-viewer">GitHub</a> · <a href="https://doc.file-viewer.app/">Docs</a> · <a href="https://demo.file-viewer.app/">Live demo</a> · <a href="https://doc.file-viewer.app/guide/formats">Format matrix</a> · <a href="https://github.com/flyfish-dev/file-viewer/issues">Issues</a> · <a href="https://github.com/flyfish-dev/file-viewer/blob/main/packages/components/vue3/README.zh-CN.md">简体中文</a>
|
|
13
17
|
</p>
|
|
14
18
|
|
|
15
19
|
<p>
|
|
@@ -18,10 +22,23 @@
|
|
|
18
22
|
|
|
19
23
|
> ⭐ If File Viewer helps you, please [star the repo on GitHub](https://github.com/flyfish-dev/file-viewer).
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
## Quick start
|
|
26
|
+
|
|
27
|
+
Create an application with renderers and local assets configured:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx file-viewer-cli@latest create my-viewer --framework vue3 --profile standard
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
For an existing project, use `npx file-viewer-cli@latest add .`, or follow the [manual integration guide](https://doc.file-viewer.app/guide/on-demand-renderers). The component alone does not install document engines or deploy their Worker/WASM files.
|
|
34
|
+
|
|
35
|
+
## Manual integration
|
|
36
|
+
|
|
37
|
+
The examples below require the matching renderer preset and self-hosted assets. The CLI configures these for you; a bare component install is not a PDF or Office viewer.
|
|
22
38
|
|
|
23
39
|
```bash
|
|
24
|
-
npm install vue @file-viewer/vue3
|
|
40
|
+
npm install vue @file-viewer/vue3 @file-viewer/preset-standard file-viewer-copy-assets
|
|
41
|
+
npx --no-install file-viewer-copy-assets ./public/file-viewer
|
|
25
42
|
```
|
|
26
43
|
|
|
27
44
|
```ts
|
|
@@ -35,16 +52,21 @@ createApp(App).use(FileViewer).mount('#app')
|
|
|
35
52
|
```
|
|
36
53
|
|
|
37
54
|
```vue
|
|
55
|
+
<script setup lang="ts">
|
|
56
|
+
import standardRenderers from '@file-viewer/preset-standard'
|
|
57
|
+
|
|
58
|
+
const viewerOptions = {
|
|
59
|
+
preset: standardRenderers,
|
|
60
|
+
theme: 'light' as const,
|
|
61
|
+
toolbar: { position: 'bottom-right' as const }
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
38
65
|
<template>
|
|
39
66
|
<section style="height: 100vh">
|
|
40
67
|
<file-viewer
|
|
41
|
-
ref="viewer"
|
|
42
68
|
url="/example/demo.pdf"
|
|
43
|
-
:options="
|
|
44
|
-
theme: 'light',
|
|
45
|
-
toolbar: { position: 'bottom-right' }
|
|
46
|
-
}"
|
|
47
|
-
@load-complete="handleLoadComplete"
|
|
69
|
+
:options="viewerOptions"
|
|
48
70
|
/>
|
|
49
71
|
</section>
|
|
50
72
|
</template>
|