Skip to content
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

Vue Errors when v-model and value are both specified in FormElement.vue. #19670

Open
jmchilton opened this issue Feb 20, 2025 · 1 comment
Open

Comments

@jmchilton
Copy link
Member

FormElement.vue has some low hanging fruit that I can fix, but we have a few component calls where we specified both :value and v-model. I can see why vue-tsc would call this an error - I'm actually not sure why this works at all but clearly it does. The vue-tsc error is An object literal cannot have multiple properties with the same name..

Some reading is here:

There is an interesting comment probably related in that file.

/** TODO: remove attrs computed.
 useAttrs is *not* reactive, and does not play nice with type safety.
 It is present for compatibility with the legacy "FormParameter" component,
 but should be removed as soon as that component is removed.
 */
const attrs: ComputedRef<FormParameterAttributes> = computed(() => props.attributes || useAttrs());

The places where we are hitting this error we are using attrs as the value.

@jmchilton
Copy link
Member Author

CopyModal.vue has another instance of this.

                <BFormGroup label="Choose which datasets from the original history to include.">
                    <BFormRadio v-model="copyAll" :value="false">
                        Copy only the active, non-deleted datasets.
                    </BFormRadio>

                    <BFormRadio v-model="copyAll" :value="true"> Copy all datasets including deleted ones. </BFormRadio>
                </BFormGroup>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant