-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: The execution details of the form file upload cannot be displayed back #3978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,7 +72,7 @@ const deleteFile = (file: any) => { | |
|
|
||
| const model_value = computed({ | ||
| get: () => { | ||
| if (!model_value.value) { | ||
| if (!props.modelValue) { | ||
| emit('update:modelValue', []) | ||
| } | ||
| return props.modelValue | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The given code snippet contains the following issues and potential improvements:
CorrectionsHere’s the corrected version of the code with improved logic: const model_value = computed(() => {
return props.modelValue;
});By removing This change ensures that the |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code is clean and does not have any serious errors or issues based on the given context. However, there are minor optimizations you can make:
Type Safety: In TypeScript, it's better to explicitly specify the type of arrays when pushing items using
push(). You can avoid the need for a temporary array_resultby pushing directly intoprops.modelValue.Filtering Optimization: If
option_value_list.value.includes(r)always returns true (or false), the filtering step might be unnecessary unless the list contains multiple values.Here's the optimized version of the code:
These changes ensure that the code remains efficient while adhering to TypeScript best practices.