@koi-br/ocr-web-sdk 1.0.26 → 1.0.27

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.
@@ -1,4 +1,4 @@
1
- import { g as getAugmentedNamespace, a as getDefaultExportFromCjs } from "./index-CqSyQjJ2.mjs";
1
+ import { g as getAugmentedNamespace, a as getDefaultExportFromCjs } from "./index-5LNwsgpW.mjs";
2
2
  function _mergeNamespaces(U, W) {
3
3
  for (var Z = 0; Z < W.length; Z++) {
4
4
  const s0 = W[Z];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koi-br/ocr-web-sdk",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "一个支持多种Office文件格式预览的Vue3组件SDK,包括PDF、Word、Excel、图片、OFD、TIF等格式",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
package/preview/index.vue CHANGED
@@ -131,7 +131,7 @@
131
131
  </template>
132
132
 
133
133
  <script setup>
134
- import { ref, onBeforeUnmount, computed } from 'vue';
134
+ import { ref, onBeforeUnmount, computed, watch } from 'vue';
135
135
  import { Message, Button as AButton } from '@arco-design/web-vue';
136
136
  import ImagePreview from './ImagePreview.vue';
137
137
  import PdfPreview from './PdfPreview.vue';
@@ -212,6 +212,20 @@ const imagePreviewUrl = computed(() => {
212
212
  return fileUrl.value;
213
213
  });
214
214
 
215
+ // 监听 imageProps 的变化,自动设置 fileType
216
+ watch(
217
+ () => props.imageProps?.url || props.imageProps?.urls,
218
+ (newUrl) => {
219
+ if (newUrl) {
220
+ // 如果传入了图片URL,自动设置fileType为image
221
+ if (fileType.value !== 'image') {
222
+ fileType.value = 'image';
223
+ }
224
+ }
225
+ },
226
+ { immediate: true }
227
+ );
228
+
215
229
  // 添加 AbortController 的引用
216
230
  const abortController = ref(null);
217
231