Skip to content
Permalink
Browse files

add data

  • Loading branch information...
jshawl committed Feb 1, 2017
1 parent 88346c5 commit 4a6e34ae7c4558cddb6c1d14b8e66ec7cff52407
Showing with 14 additions and 2 deletions.
  1. +14 −2 index.html
@@ -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'

0 comments on commit 4a6e34a

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