@yxhl/specter-pui-vtk 1.0.83 → 1.0.84

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yxhl/specter-pui-vtk",
3
- "version": "1.0.83",
3
+ "version": "1.0.84",
4
4
  "description": "雅心互联 Vue 3 + Vuetify3 组件库",
5
5
  "type": "module",
6
6
  "main": "./dist/specter-pui.umd.js",
@@ -154,7 +154,7 @@
154
154
  </template>
155
155
 
156
156
  <script setup>
157
- import { computed, ref, watch } from 'vue';
157
+ import { computed, nextTick, ref, watch } from 'vue';
158
158
  import Request from '../../commons/request.js';
159
159
 
160
160
  defineOptions({
@@ -273,16 +273,22 @@ const previewTranslateX = ref(0);
273
273
  const previewTranslateY = ref(0);
274
274
  const previewDragState = ref(null);
275
275
 
276
- // 内部维护文件列表
276
+ // 内部维护文件列表
277
277
  const fileList = ref([]);
278
-
279
- watch(
280
- () => props.modelValue,
281
- (val) => {
282
- // 统一接收外部传入的 URL 列表或文件对象列表。
278
+ let isSyncingModel = false;
279
+
280
+ watch(
281
+ () => props.modelValue,
282
+ (val) => {
283
+ if (isSyncingModel) {
284
+ isSyncingModel = false;
285
+ return;
286
+ }
287
+
288
+ // Accept external URL lists or file object lists.
283
289
  fileList.value = normalizeFileList(val || []);
284
- },
285
- );
290
+ },
291
+ );
286
292
 
287
293
  /* -------------------- 工具函数 -------------------- */
288
294
  let uidCounter = 0;
@@ -433,12 +439,16 @@ const addFile = (file) => {
433
439
  emit('change', file, fileList.value);
434
440
  };
435
441
 
436
- const syncModel = () => {
437
- const urls = fileList.value
438
- .filter((f) => f.status === 'success' && f.url)
439
- .map((f) => String(f.url));
440
- emit('update:modelValue', urls);
441
- };
442
+ const syncModel = () => {
443
+ const urls = fileList.value
444
+ .filter((f) => f.status === 'success' && f.url)
445
+ .map((f) => String(f.url));
446
+ isSyncingModel = true;
447
+ emit('update:modelValue', urls);
448
+ nextTick(() => {
449
+ isSyncingModel = false;
450
+ });
451
+ };
442
452
 
443
453
  /* -------------------- 上传逻辑 -------------------- */
444
454
  const uploadFile = (file) => {