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

31 lines
671 B
Svelte
Raw Normal View History

2020-07-26 16:02:15 +00:00
<ShipItem {cost} {mass}>
<Field label="cargo">
<input type="number" min="0" bind:value={space}/>
</Field>
</ShipItem>
<script>
2021-05-17 13:48:31 +00:00
import get from 'lodash/get.js';
import ShipItem from '$lib/components/ShipItem/index.svelte';
import Field from '$lib/components/Field/index.svelte';
import dux from '$lib/dux/cargo';
2020-07-26 16:02:15 +00:00
2020-07-26 16:19:52 +00:00
import {getContext, createEventDispatcher} from 'svelte';
2020-07-26 16:02:15 +00:00
const ship = getContext('ship');
export let space = 0;
export let cost = 0;
export let mass = 0;
2020-07-26 16:19:52 +00:00
const dispatch = createEventDispatcher();
$: dispatch( 'set_cargo', dux.actions.set_cargo( space ) );
2020-07-26 16:02:15 +00:00
</script>
<style>
input {
width: 5em;
}
</style>