Skip to content
Permalink
Browse files

display children

  • Loading branch information...
jshawl committed Feb 2, 2017
1 parent 8d5fcf9 commit 4134c5af005b0b443007891f220ba78750f4ed01
Showing with 11 additions and 5 deletions.
  1. +11 −5 index.html
@@ -18,22 +18,28 @@
</div>
</script>
<script type="x-template" id='folder'>
<div v-on:click="toggleExpand()">
{{file.name}}/
<span v-if='isOpen'>show children</span>
<div>
<div v-on:click="toggleExpand()">
{{file.name}}/
</div>
<tree v-if='isOpen && file.files' :children='file.files'></tree>
</div>
</script>
<script>
let files = [
{tag: 'folder', name: 'dir1'},
{tag: 'folder', name: 'dir1', files: [
{tag: 'file', name: 'fileA'},
{tag: 'file', name: 'fileB'}
]},
{tag: 'folder', name: 'dir2'},
{tag: 'file', name: 'file1'}
]
Vue.component('tree',{
template: '#tree',
props: ['children'],
data(){
return {
files
files: this.children || files
}
}
})

0 comments on commit 4134c5a

Please sign in to comment.
You can’t perform that action at this time.