diff --git a/frontend/src/components/business/ms-add-attachment/index.vue b/frontend/src/components/business/ms-add-attachment/index.vue index 862c022257..24da337a85 100644 --- a/frontend/src/components/business/ms-add-attachment/index.vue +++ b/frontend/src/components/business/ms-add-attachment/index.vue @@ -376,7 +376,10 @@ fileList.value = [{ ...file, fileId: file.uid || '', fileName: file.name || '' }]; inputFileName.value = file.name || ''; } - emit('change', fileList.value); + nextTick(() => { + // fileList赋值以后需要 nextTick 才能获取到更新后的值 + emit('change', fileList.value); + }); } const inputFilesPopoverVisible = ref(false); diff --git a/frontend/src/components/pure/ms-time-selector/MsTimeSelector.vue b/frontend/src/components/pure/ms-time-selector/MsTimeSelector.vue index d4a76dc524..58984ec246 100644 --- a/frontend/src/components/pure/ms-time-selector/MsTimeSelector.vue +++ b/frontend/src/components/pure/ms-time-selector/MsTimeSelector.vue @@ -99,9 +99,15 @@ }); } - onBeforeMount(() => { - initNumberAndType(); - }); + watch( + () => modelValue.value, + () => { + initNumberAndType(); + }, + { + immediate: true, + } + );