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
"An object literal cannot have multiple properties with the same name" error with b-form-checkbox #1969
Comments
I am seeing this error too. I'm using the Not sure how that would be fixed to be honest. Volar doesn't really have a way of knowing when a custom component should be treated like a native checkbox element. Maybe if there was a way to add It may just need to wait until these component libraries implement types for their components. 😞 If I find a workaround I will share it here! |
See #1821 (comment) |
Is there a way to make |
Ok stupid me, I updated volar in VSCode but forgot to update |
Did you get it working? We are also using vuetify 2 and vue 2.7, and getting this error with volar. |
Unfortunately no, I never did get it working with the new compiler option. What I ended up doing was wrap the checkbox component in my own component, and instead of using the // AppCheckbox.vue
<script lang="ts">
export default { inheritAttrs: false };
</script>
<script setup lang="ts">
defineProps<{ selectedValue: unknown }>();
</script>
<template>
<v-checkbox
:value="selectedValue"
:input-value="$attrs.value"
v-bind="$attrs"
v-on="$listeners"
@change="$listeners.input"
/>
</template>
|
We're using vuetify 2 and vue 2.7 as well, and adding the following piece of configuration in the "experimentalModelPropName": {
"checked": {
"input": {
"type": "checkbox"
},
"v-checkbox": true
}
} I'm not sure I really understand the magic though... |
The error
An object literal cannot have multiple properties with the same name
happens with<b-form-checkbox>
(bootstrap-vue) when having bothv-model
and:value
defined. I think this is becausev-model
is desugaring into:value
, but in this case it should be usingchecked
.There's a check for this for the native input elements
input[type=checkbox]
andinput[type=radio]
involar/vue-language-tools/vue-language-core/src/generators/template.ts#1794
.The text was updated successfully, but these errors were encountered: