Skip to content

Conflict between grandparent attribute and grandchild property #6504

Closed as not planned
@cokuna-pavelkosolapov

Description

@cokuna-pavelkosolapov

Vue version

3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#eNp9kj1PwzAQhv/K4cVFamNFZYrSSoiFsRIDi5fQOG1K/CH7UoSi/HfOSSgpqrrdl++9e84de3YuObeKZSwPe187hKCwdVtpau2sR3ix2kHlrQaeiOjEcn5Jd+BVBf1UMaak2VsTEHQ4wCbmF/xVNY2Fd+ub8oE/SpOLUY10yEGlXVOgIg8gHxSzYiPZ+mkt2RCk8DHddt3Qs+9zQd4Ur41rEc4rbUvV0COqmB7lw7xk5uKiwJZsnHylC5ecgjW0eher5ZQIkmUwRGKMNoq+ZEdEFzIhQrWPBE4hsf4gyEp8a7DWKlFBrz68/QrKU2PJYotemp4kf7ndx5xecU4n0DNUc1ASB1DpSIpHe1d4ZZD/IQuNRRAzFhHaDIY002yD1o3hxjs6b12gS5aqqo3aRW8xIsOCUAF+O5XBG/raHJaxqmgbzIDbT04/AwjB9cX/rVHW5xsDx4v7ix11uqInnHGV8cX8qv0P8x3ulg==

Steps to reproduce

It can be seen right after launch.

What is expected?

  1. Attribute state should be set on the div as an HTML-Attribute with value 343
  2. Property state should be shown in the content as a "CompParent" value.
  3. Besides it shouldn't throw a warning about type mismatch.

What is actually happening?

  1. attribute a="343" is missing
  2. Content: a: 343
  3. Warning: Invalid prop: type check failed for prop "a". Expected String with value "343", got Number with value 343. at <Comp1a=343> at <Compa=343> at <Repl>

System Info

No response

Any additional comments?

The attributes from a component will be inherited by every nested child of the root level down to the deepest HTML-Element where the attribute could be set. But if the deepest child has a property with the same name, it causes a conflict, and somehow the grandparent attribute has a bigger priority than the property set by the direct parent.

P.S.: vue 2 does not have this problem.

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