aotds-docks/src/lib/components/Hull/Cargo/index.svelte

27 lines
518 B
Svelte
Raw Normal View History

2020-07-26 16:02:15 +00:00
<ShipItem {cost} {mass}>
<Field label="cargo">
2021-06-13 15:36:59 +00:00
<input type="number" min="0" bind:value={space} />
2020-07-26 16:02:15 +00:00
</Field>
</ShipItem>
2021-06-13 15:36:59 +00:00
<script>
import ShipItem from "$lib/components/ShipItem/index.svelte";
import Field from "$lib/components/Field/index.svelte";
2020-07-26 16:02:15 +00:00
2021-06-13 15:36:59 +00:00
import { getContext } from "svelte";
2020-07-26 16:02:15 +00:00
2021-06-13 15:36:59 +00:00
export let ship = getContext("ship");
2020-07-26 16:02:15 +00:00
export let space = 0;
export let cost = 0;
export let mass = 0;
2021-06-13 15:36:59 +00:00
$: ship?.dispatch_action("set_cargo", space);
</script>
2020-07-26 16:02:15 +00:00
2021-06-13 15:36:59 +00:00
<style>
2020-07-26 16:02:15 +00:00
input {
width: 5em;
}
2021-06-13 15:36:59 +00:00
</style>