Format
This commit is contained in:
parent
deea258220
commit
67c5cb977a
@ -10,19 +10,19 @@
|
|||||||
import CoordinateInfo from './CoordinateInfo.svelte';
|
import CoordinateInfo from './CoordinateInfo.svelte';
|
||||||
import { emptyxpin } from '$lib/common.js';
|
import { emptyxpin } from '$lib/common.js';
|
||||||
|
|
||||||
let tabInfo = {
|
let tabInfo = {
|
||||||
selected: 0,
|
selected: 0,
|
||||||
tabs: [
|
tabs: [
|
||||||
{
|
{
|
||||||
label: "Map",
|
label: 'Map',
|
||||||
idx: 0,
|
idx: 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Share",
|
label: 'Share',
|
||||||
idx: 1,
|
idx: 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
let initSuccess = false;
|
let initSuccess = false;
|
||||||
let coordinateTypes = [];
|
let coordinateTypes = [];
|
||||||
@ -184,12 +184,11 @@ let tabInfo = {
|
|||||||
bind:selectedCoordinateType
|
bind:selectedCoordinateType
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TabSelector bind:tabInfo />
|
<TabSelector bind:tabInfo />
|
||||||
|
|
||||||
{#if tabInfo.selected === 1}
|
|
||||||
<CoordinateInfo bind:xpin={addr} />
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
|
{#if tabInfo.selected === 1}
|
||||||
|
<CoordinateInfo bind:xpin={addr} />
|
||||||
|
{/if}
|
||||||
{:catch message}
|
{:catch message}
|
||||||
<Error {message}>Could not start core module</Error>
|
<Error {message}>Could not start core module</Error>
|
||||||
{/await}
|
{/await}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
export let xpin;
|
export let xpin;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
Hi there
|
Hi there
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
<script>
|
<script>
|
||||||
export let tabInfo;
|
export let tabInfo;
|
||||||
|
|
||||||
const updateSelectedTab = (tab) => {
|
const updateSelectedTab = (tab) => {
|
||||||
tabInfo.selected = tab.idx;
|
tabInfo.selected = tab.idx;
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ul class="flex">
|
<ul class="flex">
|
||||||
{#each tabInfo.tabs as tab}
|
{#each tabInfo.tabs as tab}
|
||||||
<li class:bg-blue-200="{tab.idx === tabInfo.selected}" on:click={() => updateSelectedTab(tab)} class="p-2 block">{tab.label}</li>
|
<li
|
||||||
{/each}
|
class:bg-blue-200={tab.idx === tabInfo.selected}
|
||||||
|
on:click={() => updateSelectedTab(tab)}
|
||||||
|
class="p-2 block"
|
||||||
|
>
|
||||||
|
{tab.label}
|
||||||
|
</li>
|
||||||
|
{/each}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user