-
Notifications
You must be signed in to change notification settings - Fork 40
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
How would I pass an object to a component inside a story? #73
Comments
Here is how I currently have it set up and things seem to be working ok.
I'm curious if there is a better, supported way of handling this type of component |
Hey! Sorry for the delay. The |
No worries—I appreciate the response! Passing individual vars is great for smaller, atomic components. But being able to create and pass an object would be great. Just thinking out loud here but maybe something like:
|
When I try this, I get |
For instance, I have a typical blade component called ticket.blade.php. Inside that component I render things like
ticket->title
and$ticket->price
. In typical Laravel fashion, I render the component by passing a whole ticket object (eloquent model) to the component like<x-card.ticket :ticket="$ticket" />
How would I do similar inside a story file? How can I pass a single $ticket object to the component inside a story?
In the button example, there are single variables like
$label
, etc. but I can't figure out how to create a story with an object rather than just individual vars.Hopefully that question makes sense :) Thanks!
The text was updated successfully, but these errors were encountered: