component tree layout/screen agnostic

This commit is contained in:
Martin McKeaveney 2020-12-02 15:19:38 +00:00
parent 8cae8e1705
commit 504565c3fc
2 changed files with 13 additions and 7 deletions

View File

@ -24,11 +24,12 @@
const path = store.actions.components.findRoute(component) const path = store.actions.components.findRoute(component)
// Go to correct URL // Go to correct URL
if (layout) { $goto(`./${path}`)
$goto(`./layouts/:layout/${path}`) // if (layout) {
} else { // $goto(`./layouts/:layout/${path}`)
$goto(`./screens/:screen/${path}`) // } else {
} // $goto(`./screens/:screen/${path}`)
// }
} }
const dragstart = component => e => { const dragstart = component => e => {

View File

@ -28,6 +28,7 @@
store.actions.components.create(component._component, component.presetProps) store.actions.components.create(component._component, component.presetProps)
const path = store.actions.components.findRoute($store.currentComponentInfo) const path = store.actions.components.findRoute($store.currentComponentInfo)
$goto(`./:screen/${path}`) $goto(`./:screen/${path}`)
// $goto(`./${path}`)
close() close()
} }
</script> </script>
@ -39,9 +40,13 @@
class="category" class="category"
on:click={() => onCategoryChosen(category, idx)} on:click={() => onCategoryChosen(category, idx)}
class:active={idx === selectedIndex}> class:active={idx === selectedIndex}>
{#if category.icon}<i class={category.icon} />{/if} {#if category.icon}
<i class={category.icon} />
{/if}
<span>{category.name}</span> <span>{category.name}</span>
{#if category.isCategory}<i class="ri-arrow-down-s-line arrow" />{/if} {#if category.isCategory}
<i class="ri-arrow-down-s-line arrow" />
{/if}
</div> </div>
{/each} {/each}
</div> </div>