diff --git a/src/ui/components/controls/viewControl.vue b/src/ui/components/controls/viewControl.vue index 9c0afe6b5e..9e8fca04d9 100644 --- a/src/ui/components/controls/viewControl.vue +++ b/src/ui/components/controls/viewControl.vue @@ -53,8 +53,9 @@ } }, methods: { - toggle() { + toggle(event) { this.expanded = !this.expanded; + this.$emit('click', event); } } } diff --git a/src/ui/components/layout/Layout.vue b/src/ui/components/layout/Layout.vue index d9cb65dedb..03cf8bc455 100644 --- a/src/ui/components/layout/Layout.vue +++ b/src/ui/components/layout/Layout.vue @@ -13,7 +13,7 @@
- +
@@ -133,7 +133,7 @@ import MctInspector from './MctInspector.vue'; import MctMain from './MctMain.vue'; import MctStatus from './MctStatus.vue'; - import MctTree from './MctTree.vue'; + import MctTree from './mct-tree.vue'; import search from '../controls/search.vue'; import multipane from '../controls/multipane.vue'; import pane from '../controls/pane.vue'; @@ -141,7 +141,44 @@ export default { data () { return { - msg: 'Hello world!' + treeRoots: [ + { + id: 'r1', + name: 'Root 1', + children: [ + { + id: 'r1c1', + name: 'r1c1' + }, + { + id: 'r1c2', + name: 'r1c2' + }, + { + id: 'r1c3', + name: 'r1c3' + }, + ] + },{ + id: 'r2', + name: 'Root 2', + children: [ + { + id: 'r2c1', + name: 'r2c1', + children: [ + { + id: 'r2c1c1', + name: 'r2c1c1' + } + ] + } + ] + },{ + id: 'r3', + name: 'Root 3' + } + ] } }, methods: { diff --git a/src/ui/components/layout/mct-tree.vue b/src/ui/components/layout/mct-tree.vue new file mode 100644 index 0000000000..15851c5e46 --- /dev/null +++ b/src/ui/components/layout/mct-tree.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/src/ui/components/layout/tree-item.vue b/src/ui/components/layout/tree-item.vue new file mode 100644 index 0000000000..548bc42790 --- /dev/null +++ b/src/ui/components/layout/tree-item.vue @@ -0,0 +1,44 @@ + + +