weird problem with spreads?

This commit is contained in:
Yanick Champoux 2022-03-26 14:37:34 -04:00
parent d77d280bd5
commit 63f8f70a93
3 changed files with 17 additions and 7 deletions

View File

@ -10,12 +10,13 @@
<JsonOutput /> <JsonOutput />
</div> </div>
<div class:hide={activeTab !== 'print'}> <div class:hide={activeTab !== 'print'}>
<PrintOutput /> <PrintOutput ship={$state}/>
</div> </div>
</main> </main>
<script> <script>
import { getContext } from 'svelte';
import { Modal, Card, Nav } from "svelte-chota"; import { Modal, Card, Nav } from "svelte-chota";
import Ribbon from "./Ribbon.svelte"; import Ribbon from "./Ribbon.svelte";
@ -27,6 +28,8 @@
let activeTab = 'editor'; let activeTab = 'editor';
$: console.log(activeTab); $: console.log(activeTab);
const {state} = getContext('ship');
</script> </script>
<style> <style>

View File

@ -3,11 +3,15 @@
</h1> </h1>
<div class="details"> <div class="details">
<h2>{shipClass}-class, {shipType}</h2> <h2>
{#if shipClass}
{shipClass}-class,
{/if}
{shipType}</h2>
<div class="reqs"> <div class="reqs">
<Cost cost={reqs.cost} /> <Cost cost={cost} />
&nbsp; &nbsp;
<Mass mass={reqs.mass} /> <Mass mass={mass} />
</div> </div>
</div> </div>
@ -17,7 +21,8 @@
export let shipClass; export let shipClass;
export let shipType; export let shipType;
export let reqs = {}; export let cost = 0;
export let mass = 0;
</script> </script>
<style> <style>

View File

@ -1,7 +1,9 @@
<div class="print-output"> <div class="print-output">
<Identification <Identification
{...ship.identification} shipClass={ship.identification.shipClass}
reqs={ship.reqs} shipType={ship.identification.shipType}
cost={ship.reqs?.cost}
mass={ship.reqs?.mass}
/> />
<div class="section-2"> <div class="section-2">