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
andprice
of my rows? (I know I can do it withrows = 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'srow
prop. You can use the shortcutbind:row
as an alias ofbind: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