Skip to content
Discussion options

You must be logged in to vote

Would be shorter to do it like:

<span :drink="drink" :food="food">...</span>

Is the intent to pass in an object literal?

I think a better feature idea would be to auto bind if no expression is passed in, so you could write:

<div x-data="{ drink: 'soda', food: 'pizza' }">
  <span :drink :food>...</span>
</div>

But after typing that out and looking at the preview, I don't necessarily like it. Feels more natural to me to keep it explicit.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@KevinBatdorf
Comment options

@surgiie
Comment options

@KevinBatdorf
Comment options

@surgiie
Comment options

@KevinBatdorf
Comment options

Answer selected by surgiie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants