Skip to content

Different behavior when passing values to components #249

@Bberto-22

Description

@Bberto-22

Hi,

According to the documentation, dynamic attributes require the : notation (e.g., <c-component :prop="True"></c-card>). However, when using <c-vars>, both of the following cases appear to be interpreted the same way, even though : isn't required:

<c-vars prop="False"></c-vars>  <!-- Interpreted as a boolean -->
<c-vars :prop="False"></c-vars> <!-- Also interpreted as a boolean -->

In contrast, when using <c-component>, the behavior is different:

<c-component prop="True"></c-card>  <!-- Interpreted as a string -->
<c-component :prop="True"></c-card> <!-- Correctly interpreted as a boolean -->

This difference between <c-vars> and <c-component> was a bit unexpected and I couldn't find anything in the documentation about it.

Would it make sense to clarify this in the documentation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions