diff --git a/src/components/Game.vue b/src/components/Game.vue index dda801f..33067af 100644 --- a/src/components/Game.vue +++ b/src/components/Game.vue @@ -29,8 +29,9 @@ const layerKeys = computed(() => Object.keys(layers)); const useHeader = projInfo.useHeader; function gatherLayerProps(layer: GenericLayer) { - const { display, minimized, minWidth, name, color, style, classes, links, minimizable } = layer; - return { display, minimized, minWidth, name, color, style, classes, links, minimizable }; + const { display, minimized, minWidth, name, color, style, classes, links, minimizable, nodes } = + layer; + return { display, minimized, minWidth, name, color, style, classes, links, minimizable, nodes }; } diff --git a/src/components/Layer.vue b/src/components/Layer.vue index cb26662..7ca24ae 100644 --- a/src/components/Layer.vue +++ b/src/components/Layer.vue @@ -10,7 +10,7 @@ :class="[{ showGoBack }, unref(classes)]" v-else > - + @@ -24,11 +24,11 @@ import Links from "components/links/Links.vue"; import projInfo from "data/projInfo.json"; import { CoercableComponent, StyleValue } from "features/feature"; -import { Link } from "features/links"; +import { Link, LinkNode } from "features/links"; import { PersistentRef } from "game/persistence"; import player from "game/player"; import { computeComponent, processedPropType, wrapRef } from "util/vue"; -import { computed, defineComponent, nextTick, PropType, toRefs, unref, watch } from "vue"; +import { computed, defineComponent, nextTick, PropType, Ref, ref, toRefs, unref, watch } from "vue"; export default defineComponent({ components: { Links }, @@ -61,7 +61,11 @@ export default defineComponent({ style: processedPropType(String, Object, Array), classes: processedPropType>(Object), links: processedPropType(Array), - minimizable: processedPropType(Boolean) + minimizable: processedPropType(Boolean), + nodes: { + type: Object as PropType>>, + required: true + } }, setup(props) { const { display, index, minimized, minWidth, tab } = toRefs(props); @@ -80,6 +84,16 @@ export default defineComponent({ updateTab(minimized, minWidth) ); + const linksRef = ref(null); + watch( + () => linksRef.value?.nodes, + nodes => { + if (nodes) { + props.nodes.value = nodes; + } + } + ); + function updateTab(minimized: boolean, minWidth: number) { const tabValue = tab.value(); if (tabValue != undefined) { @@ -102,6 +116,7 @@ export default defineComponent({ return { component, showGoBack, + linksRef, unref, goBack }; diff --git a/src/components/Modal.vue b/src/components/Modal.vue index b53de06..967036c 100644 --- a/src/components/Modal.vue +++ b/src/components/Modal.vue @@ -17,10 +17,9 @@ default header