@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 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
- The standard Vue 3 native component package for Flyfish File Viewer. It owns the Vue 3 component lifecycle and local controller while consuming the shared `@file-viewer/core` contracts and core browser engine. It exposes plugin install, component props, lifecycle events, search, zoom, print, export, and document-location ref APIs.
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>