Skip to content

Commit

Permalink
add data
Browse files Browse the repository at this point in the history
  • Loading branch information
jshawl committed Feb 1, 2017
1 parent 88346c5 commit 4a6e34a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions index.html
Expand Up @@ -9,12 +9,24 @@
</div>
<script type='x-template' id='tree'>
<div>
Hello
<div v-for="file in files">
{{file.name}}<span v-if="file.tag == 'folder'">/</span>
</div>
</div>
</script>
<script>
let files = [
{tag: 'folder', name: 'dir1'},
{tag: 'folder', name: 'dir2'},
{tag: 'file', name: 'file1'}
]
Vue.component('tree',{
template: '#tree'
template: '#tree',
data(){
return {
files
}
}
})
new Vue({
el: '#app'
Expand Down

0 comments on commit 4a6e34a

Please sign in to comment.