4 ms·
In Svelte, <Board {game} /> Is just a shorthand for: <Board game={game} /> Spreading also works, although it's not nearly as used: <Board {...{game}}
by mkishi 7y ago
In Svelte,
<Board {game} />
Is just a shorthand for:
<Board game={game} />
Spreading also works, although it's not nearly as used:
<Board {...{game}} />
Boolean HTML attributes like "checked" can be used with boolean variables as-is:
<input type="checkbox" {checked}>
<input type="checkbox" checked={someBoolean}>
I highly recommend anyone to go through the tutorial (at least once Google Cloud Run issues are solved) to get a feel of how things work together.
- benatkin 7y agoOh, I see. Looking further into the docs, I see that a JavaScript expression can be added inside an attribute string: <a href="page/{p}">page {p}</a> https://svelte.dev/docs#Attributes_and_props https://svelte.dev/docs#Attributes_and_props It seems like a neat design.