diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-03-03 20:57:50 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-03-03 20:57:50 +1100 |
| commit | 6552c64888dbc8741b28b09ea33f9c8883497661 (patch) | |
| tree | f9e0b3eca41560567f2808f75ffa3e7c5d3a6fbd /src/App.vue | |
| parent | 511afb14b81e711c8d72b81274b7891d47b0a7be (diff) | |
Add basic sweep-to-side layout
Diffstat (limited to 'src/App.vue')
| -rw-r--r-- | src/App.vue | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/App.vue b/src/App.vue index 5c7c293..b1efd4b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,15 @@ <script> import tol from './tol.json'; +function addTileCounts(tree){ + if (tree.children && tree.children.length > 0){ + tree.children.forEach(addTileCounts) + tree.tileCount = tree.children.reduce((acc, val) => acc + val.tileCount, 0); + } else { + tree.tileCount = 1; + } +} +addTileCounts(tol); + import TileTree from "./components/TileTree.vue"; export default { data() { |
