Skip to content

No conversion from kebab-case to camelCase for property binding #13055

Open
@padcom

Description

@padcom

Vue version

3.5.13

Link to minimal reproduction

https://github.com/padcom/vue-property-mapping-bug

Steps to reproduce

npm install
npm start

What is expected?

When dot-binding to a property the conversion from kebab-case to camelCase should happen just as well as when it is with v-bind-ing attributes.

There is an ESLint rule (vue/attribute-hyphenation) that has no separate configuration for prop vs attr binding, which makes me assume both should work the same.

What is actually happening?

When binding using property binding with a .test-prop the actual assigned property is test-prop instead of testProp as it would be with attribute binding.

System Info

Google CHrome 134.0.6998.88 (Official Build) (64-bit)

Any additional comments?

I am not sure how this should be handled. There are at least two options:

  • make it work the same for both colon binding to attributes and dot binding for properties where the kebab-case to camelCase conversion happens automatically for both Vue.js component and HTMLElement
  • change the ESLint rule to be aware of this conversion misalignment and issue the warning only when it makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.has workaroundA workaround has been found to avoid the problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions