chromatic-lattice/src/components/features/tree/Tree.vue

52 lines
1.3 KiB
Vue
Raw Normal View History

2022-01-14 04:25:47 +00:00
<template>
<span class="row" v-for="(row, index) in nodes" :key="index">
<TreeNode v-for="(node, nodeIndex) in row" :key="nodeIndex" v-bind="wrapFeature(node)" />
</span>
<span class="left-side-nodes" v-if="leftSideNodes">
<TreeNode
v-for="(node, nodeIndex) in leftSideNodes"
:key="nodeIndex"
v-bind="wrapFeature(node)"
small
/>
</span>
<span class="side-nodes" v-if="rightSideNodes">
<TreeNode
v-for="(node, nodeIndex) in rightSideNodes"
:key="nodeIndex"
v-bind="wrapFeature(node)"
small
/>
</span>
</template>
2022-01-25 04:23:30 +00:00
<script lang="ts">
2022-01-14 04:25:47 +00:00
import { FeatureComponent, wrapFeature } from "@/features/feature";
import { GenericTree } from "@/features/tree";
2022-01-25 04:23:30 +00:00
import { defineComponent } from "vue";
2022-01-14 04:25:47 +00:00
import TreeNode from "./TreeNode.vue";
2022-01-25 04:23:30 +00:00
// https://github.com/thepaperpilot/The-Modding-Tree-X/issues/1
export default defineComponent(function Grid(props: FeatureComponent<GenericTree>) {
return { ...props, TreeNode, wrapFeature };
});
2022-01-14 04:25:47 +00:00
</script>
<style scoped>
.row {
margin: 50px auto;
}
.left-side-nodes {
position: absolute;
left: 15px;
top: 65px;
}
.side-nodes {
position: absolute;
right: 15px;
top: 65px;
}
</style>