🚧 Site > Add file
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
<template src="./template.html"></template>
|
||||
<script src="./script.js"></script>
|
||||
<style src="./style.styl" lang="stylus" scoped></style>
|
||||
@@ -0,0 +1,16 @@
|
||||
import Versions from '@/components/versions'
|
||||
|
||||
export default
|
||||
{
|
||||
name: 'file',
|
||||
|
||||
components:
|
||||
{
|
||||
Versions
|
||||
},
|
||||
|
||||
props:
|
||||
{
|
||||
content: { type: Object }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
.file
|
||||
position absolute
|
||||
top 0
|
||||
right 0
|
||||
width 75%
|
||||
height 100%
|
||||
background rgba(0, 255, 0, 0.3)
|
||||
|
||||
header
|
||||
position absolute
|
||||
top 0
|
||||
left 0
|
||||
@@ -0,0 +1,7 @@
|
||||
<div class="file">
|
||||
<header>
|
||||
File
|
||||
{{ content.path.directory }} {{ content.name }}
|
||||
</header>
|
||||
<versions :content="content.versions"></versions>
|
||||
</div>
|
||||
@@ -14,5 +14,9 @@ export default
|
||||
|
||||
methods:
|
||||
{
|
||||
onNameClick()
|
||||
{
|
||||
this.$store.commit('setFile', this.content.data.path.full)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<div>
|
||||
<div class="name" :style="{ paddingLeft:depth * 20 + 'px' }">
|
||||
<div class="name" :style="{ paddingLeft:depth * 20 + 'px' }" @click.prevent="onNameClick">
|
||||
{{ content.name }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,4 +1,5 @@
|
||||
import FilesTree from '@/components/files-tree'
|
||||
import File from '@/components/file'
|
||||
|
||||
export default
|
||||
{
|
||||
@@ -6,7 +7,8 @@ export default
|
||||
|
||||
components:
|
||||
{
|
||||
FilesTree
|
||||
FilesTree,
|
||||
File
|
||||
},
|
||||
|
||||
computed:
|
||||
@@ -14,6 +16,10 @@ export default
|
||||
project()
|
||||
{
|
||||
return this.$store.state.project
|
||||
},
|
||||
file()
|
||||
{
|
||||
return this.$store.state.file
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<div>
|
||||
{{ project.name }}
|
||||
|
||||
<files-tree></files-tree>
|
||||
<file v-if="file" :content="file.data"></file>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<template src="./template.html"></template>
|
||||
<script src="./script.js"></script>
|
||||
<style src="./style.styl" lang="stylus" scoped></style>
|
||||
@@ -0,0 +1,9 @@
|
||||
export default
|
||||
{
|
||||
name: 'version',
|
||||
|
||||
props:
|
||||
{
|
||||
content: { type: Object }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="version">
|
||||
{{ content }}
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
<template src="./template.html"></template>
|
||||
<script src="./script.js"></script>
|
||||
<style src="./style.styl" lang="stylus" scoped></style>
|
||||
@@ -0,0 +1,16 @@
|
||||
import Version from '@/components/version'
|
||||
|
||||
export default
|
||||
{
|
||||
name: 'versions',
|
||||
|
||||
components:
|
||||
{
|
||||
Version
|
||||
},
|
||||
|
||||
props:
|
||||
{
|
||||
content: { type: Array }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
.versions
|
||||
position absolute
|
||||
top 30px
|
||||
left 0
|
||||
width 25%
|
||||
height 100%
|
||||
background rgba(255, 0, 0, 0.3)
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="versions">
|
||||
<version v-for="version of content" :content="version"></version>
|
||||
</div>
|
||||
Reference in New Issue
Block a user