Site > File tree > Add folder icons

This commit is contained in:
brunosimon
2017-08-15 23:41:03 +02:00
parent 4dc7474915
commit 555bff11ab
3 changed files with 11 additions and 3 deletions
+3 -1
View File
@@ -35,7 +35,9 @@ export default
git: ['gitignore', 'gitkeep'], git: ['gitignore', 'gitkeep'],
xml: ['xml'], xml: ['xml'],
twig: ['twig'], twig: ['twig'],
c: ['c', 'h'] c: ['c', 'h'],
folder: ['folder'],
'folder-active': ['folder-active']
} }
this.icon = 'random' this.icon = 'random'
@@ -1,4 +1,5 @@
import FilesTreeFile from '@/components/files-tree-file' import FilesTreeFile from '@/components/files-tree-file'
import FileIcon from '@/components/file-icon/'
export default export default
{ {
@@ -6,7 +7,8 @@ export default
components: components:
{ {
FilesTreeFile FilesTreeFile,
FileIcon
}, },
props: props:
@@ -1,6 +1,10 @@
<div> <div>
<a href="#" class="name" :style="{ paddingLeft:depth * 20 + 'px' }" @click.prevent="onNameClick"> <a href="#" class="name" :style="{ paddingLeft:depth * 20 + 'px' }" @click.prevent="onNameClick">
<file-icon class="icon" extension="folder-active" v-show="open"></file-icon>
<file-icon class="icon" extension="folder" v-show="!open"></file-icon>
<span class="text">
{{ content.name }} {{ content.name }}
</span>
</a> </a>
<div v-show="open"> <div v-show="open">
<files-tree-folder v-for="folder of content.folders" :key="folder.name" :content="folder" :depth="depth + 1"></files-tree-folder> <files-tree-folder v-for="folder of content.folders" :key="folder.name" :content="folder" :depth="depth + 1"></files-tree-folder>