Skip to content

[LiveComponent] Add an data-attribute to modify the value of a prop #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BeyerJC opened this issue Dec 9, 2021 · 0 comments
Closed

Comments

@BeyerJC
Copy link
Contributor

BeyerJC commented Dec 9, 2021

Hey everyone !

I think it would be nice if we had an additional data-attribute to set the value of a prop from elements like . In my specific case, i tried to create a pagination and want to update the prop "page".

Im thinking of something like the data-model attribute --> data-value for example.

The result could be something like this

<a class="page-link" data-action="live#update" data-model="page" data-value="{{ page }}">{{ page }}</a>

weaverryan added a commit that referenced this issue Jan 18, 2022
…itDE)

This PR was merged into the 2.x branch.

Discussion
----------

[LiveComponent] consider data-value attribute

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| Tickets       |  #195
| License       | MIT

Allow to set the value using data-value. This can be handy if the model is updated from an \<a\> or \<button\> to set it to a fixed value for example.

Commits
-------

0ae0593 consider data-value attribute
@BeyerJC BeyerJC closed this as completed Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant