Skip to content

Commit

Permalink
handle events
Browse files Browse the repository at this point in the history
  • Loading branch information
jshawl committed Feb 1, 2017
1 parent 4a6e34a commit 022a9fc
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions index.html
Expand Up @@ -9,9 +9,14 @@
</div> </div>
<script type='x-template' id='tree'> <script type='x-template' id='tree'>
<div> <div>
<div v-for="file in files"> <div v-for="file in files">
{{file.name}}<span v-if="file.tag == 'folder'">/</span> <div v-if="file.tag == 'folder'" v-on:click='toggleExpand()'>
</div> {{file.name}}/
</div>
<div v-else>
{{file.name}}
</div>
</div>
</div> </div>
</script> </script>
<script> <script>
Expand All @@ -22,6 +27,11 @@
] ]
Vue.component('tree',{ Vue.component('tree',{
template: '#tree', template: '#tree',
methods: {
toggleExpand: function(){
console.log('togglin!')
}
},
data(){ data(){
return { return {
files files
Expand All @@ -33,4 +43,4 @@
}) })
</script> </script>
</body> </body>
</html> </html>

0 comments on commit 022a9fc

Please sign in to comment.