diff options
Diffstat (limited to 'gfx/wr/debugger/src/components/TreeView.vue')
-rw-r--r-- | gfx/wr/debugger/src/components/TreeView.vue | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gfx/wr/debugger/src/components/TreeView.vue b/gfx/wr/debugger/src/components/TreeView.vue new file mode 100644 index 0000000000..bde473bda2 --- /dev/null +++ b/gfx/wr/debugger/src/components/TreeView.vue @@ -0,0 +1,40 @@ +<template> + <li> + <div v-on:click="toggle"> + <span v-if="isFolder">[{{open ? '-' : '+'}}]</span> + {{model.description}} + </div> + <ul style="padding-left: 1em; line-height: 1.5em;" v-show="open" v-if="isFolder"> + <treeview v-for="model in model.children" :model="model"></treeview> + </ul> + </li> +</template> + +<script> +export default { + name: 'treeview', + props: [ + 'model', + ], + data: function () { + return { + open: false + } + }, + computed: { + isFolder: function () { + return this.model.children && this.model.children.length + } + }, + methods: { + toggle: function () { + if (this.isFolder) { + this.open = !this.open + } + }, + }, +} +</script> + +<style> +</style> |