We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a6e34a commit 022a9fcCopy full SHA for 022a9fc
index.html
@@ -9,9 +9,14 @@
9
</div>
10
<script type='x-template' id='tree'>
11
<div>
12
- <div v-for="file in files">
13
- {{file.name}}<span v-if="file.tag == 'folder'">/</span>
14
- </div>
+ <div v-for="file in files">
+ <div v-if="file.tag == 'folder'" v-on:click='toggleExpand()'>
+ {{file.name}}/
15
+ </div>
16
+ <div v-else>
17
+ {{file.name}}
18
19
20
21
</script>
22
<script>
@@ -22,6 +27,11 @@
27
]
23
28
Vue.component('tree',{
24
29
template: '#tree',
30
+ methods: {
31
+ toggleExpand: function(){
32
+ console.log('togglin!')
33
+ }
34
+ },
25
35
data(){
26
36
return {
37
files
@@ -33,4 +43,4 @@
43
})
44
45
</body>
-</html>
46
+</html>
0 commit comments