Skip to content

Object v-bind taking precedence over earlier attributes #2059

Closed

Description

@skirtles-code

Version

3.0.0-rc.10

Reproduction link

https://jsfiddle.net/skirtle/f78Lhcmt/

Steps to reproduce

The important section is this:

<my-child abc="specific" v-bind="{ abc: 'object' }" />

Note that abc is set in two different ways.

What is expected?

In Vue 2 the value of abc would have been 'specific'.

What is actually happening?

abc is 'object'.

The order of the attributes now matters.

I also experimented with using :abc for the first attribute but it doesn't seem to matter whether the prop is static or dynamic.


I know this topic has been discussed several times before but I haven't been able to find any official confirmation that this has been changed intentionally.

A look through the tests seems to suggest that this is being tested, so my guess is that it is an intentional change.

The most recent discussion I could find on this topic was 3 weeks ago. vue#11594. While that was a discussion about Vue 2 it does seem odd that the change in Vue 3 wasn't mentioned if it is indeed an intentional change.

Activity

  1. yyx990803 commented on Sep 14, 2020

    @yyx990803
    Member

    Yes, this is an intentional change (v-bind appearance order now affects merge result) and we should document it in the migration guide.

  2. CyberAP commented on Sep 28, 2020

    @CyberAP
    Contributor

    I have suggested a change that might be able to fix that: vuejs/rfcs#215

  3. locked and limited conversation to collaborators on Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions