Skip to content

Can't pass JSON with spaces inside data attributes #240

@confuzeus

Description

@confuzeus

In this component:

<button {{ attrs }}>{{ slot }}</button>

I want to pass a data attribute to it:

<c-button data-something='{"name": "John", "address": "1234 The Road"}'>Hello</c-button>

However, the component gets rendered as:

<button  data-something="" {"name":="" "john",="" "address":="" "1234"="" the="" road"}"="">hello</button>

Is this a bug or am I passing the attribute the wrong way?

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