I'm trying my best to understand the idiomatic way to create an Invoice-like form with Svelte 3.
My REPL is here: https://svelte.dev/repl/7aca36569aea49bba38e5fb8b1b0835b?version=3.24.1.
QUESTIONS:
Is this a good way to do it? Should I use a store perhaps?
Is there a way to update amountDue when I change qty
and price
of my rows? (I know I can do it with rows = rows
but it seems to me a bit not-idiomatic way, am I wrong?)
In case you need a more complete answer:
row
value to the Row's row
prop. You can use the shortcut bind:row
as an alias of bind:row={row}
.amountDue
total seems flawed as it ignores the row quantity to calculate the total price.Here's a working REPL with the desired behavior: https://svelte.dev/repl/78fa09646005441a85061e6edf9886f9?version=3.24.1