Skip to content

Commit 8d5fcf9

Browse files
committed
toggle display children
1 parent 9b4bc33 commit 8d5fcf9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<script type="x-template" id='folder'>
2121
<div v-on:click="toggleExpand()">
2222
{{file.name}}/
23+
<span v-if='isOpen'>show children</span>
2324
</div>
2425
</script>
2526
<script>
@@ -41,7 +42,12 @@
4142
props: ['file'],
4243
methods: {
4344
toggleExpand: function(){
44-
console.log('togglin!')
45+
this.isOpen = !this.isOpen
46+
}
47+
},
48+
data: function(){
49+
return {
50+
isOpen: false
4551
}
4652
}
4753
})

0 commit comments

Comments
 (0)