mirror of https://github.com/halo-dev/halo-admin
list theme file(not done)
parent
b10a4aeef8
commit
4976fdc20e
|
@ -20,6 +20,7 @@
|
||||||
"vue-clipboard2": "^0.3.0",
|
"vue-clipboard2": "^0.3.0",
|
||||||
"vue-codemirror-lite": "^1.0.4",
|
"vue-codemirror-lite": "^1.0.4",
|
||||||
"vue-cropper": "0.4.9",
|
"vue-cropper": "0.4.9",
|
||||||
|
"vue-fragment": "^1.5.0",
|
||||||
"vue-ls": "^3.2.1",
|
"vue-ls": "^3.2.1",
|
||||||
"vue-router": "^3.0.2",
|
"vue-router": "^3.0.2",
|
||||||
"vue-svg-component-runtime": "^1.0.1",
|
"vue-svg-component-runtime": "^1.0.1",
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
import service from '@/utils/service'
|
||||||
|
|
||||||
|
const baseUrl = '/admin/api/themes'
|
||||||
|
|
||||||
|
const themeApi = {}
|
||||||
|
|
||||||
|
themeApi.listFiles = () => {
|
||||||
|
return service({
|
||||||
|
url: `${baseUrl}/files`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default themeApi
|
|
@ -0,0 +1,23 @@
|
||||||
|
<template>
|
||||||
|
<fragment>
|
||||||
|
<a-tree-node v-for="(item,index) in list" :title="item.name" :key="index">
|
||||||
|
<theme-file :list="item.node"></theme-file>
|
||||||
|
</a-tree-node>
|
||||||
|
</fragment>
|
||||||
|
<!-- <ul>
|
||||||
|
<li v-for="(item,index) in list " :key="index">
|
||||||
|
<p>{{item.name}}</p>
|
||||||
|
<theme-file :list="item.node"></theme-file>
|
||||||
|
</li>
|
||||||
|
</ul> -->
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { Fragment } from 'vue-fragment'
|
||||||
|
export default {
|
||||||
|
components: { Fragment },
|
||||||
|
name: 'ThemeFile',
|
||||||
|
props: {
|
||||||
|
list: Array
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -8,6 +8,7 @@ import Tree from '@/components/Tree/Tree'
|
||||||
import MultiTab from '@/components/MultiTab'
|
import MultiTab from '@/components/MultiTab'
|
||||||
import Result from '@/components/Result'
|
import Result from '@/components/Result'
|
||||||
import IconSelector from '@/components/IconSelector'
|
import IconSelector from '@/components/IconSelector'
|
||||||
|
import ThemeFile from '@/components/Tree/ThemeFile'
|
||||||
|
|
||||||
export {
|
export {
|
||||||
AvatarList,
|
AvatarList,
|
||||||
|
@ -18,5 +19,6 @@ export {
|
||||||
Tree,
|
Tree,
|
||||||
MultiTab,
|
MultiTab,
|
||||||
Result,
|
Result,
|
||||||
IconSelector
|
IconSelector,
|
||||||
|
ThemeFile
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,24 +9,9 @@
|
||||||
<a-col :xl="6" :lg="6" :md="6" :sm="24" :xs="24">
|
<a-col :xl="6" :lg="6" :md="6" :sm="24" :xs="24">
|
||||||
<a-card hoverable title="Anatole 主题">
|
<a-card hoverable title="Anatole 主题">
|
||||||
<a-directory-tree multiple @select="onSelect" @expand="onExpand">
|
<a-directory-tree multiple @select="onSelect" @expand="onExpand">
|
||||||
<a-tree-node title="source" key="0-0">
|
<theme-file :list="files"></theme-file>
|
||||||
<a-tree-node title="css" key="0-0-1">
|
|
||||||
<a-tree-node title="style.css" key="0-0-1-2" isLeaf />
|
|
||||||
</a-tree-node>
|
|
||||||
<a-tree-node title="js" key="0-0-2" isLeaf />
|
|
||||||
<a-tree-node title="images" key="0-0-3" isLeaf />
|
|
||||||
</a-tree-node>
|
|
||||||
<a-tree-node title="module" key="0-1">
|
|
||||||
<a-tree-node title="options.ftl" key="0-1-0" isLeaf />
|
|
||||||
</a-tree-node>
|
|
||||||
<a-tree-node title="index.ftl" key="0-2-0" />
|
|
||||||
<a-tree-node title="posts.ftl" key="0-3-0" />
|
|
||||||
<a-tree-node title="category.ftl" key="0-4-0" />
|
|
||||||
<a-tree-node title="tags.ftl" key="0-5-0" />
|
|
||||||
<a-tree-node title="links.ftl" key="0-6-0" />
|
|
||||||
<a-tree-node title="page_author.ftl" key="0-7-0" />
|
|
||||||
<a-tree-node title="page_search.ftl" key="0-8-0" />
|
|
||||||
</a-directory-tree>
|
</a-directory-tree>
|
||||||
|
<!-- <theme-file :list="files"></theme-file> -->
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
@ -34,22 +19,34 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import themeApi from '@/api/theme'
|
||||||
|
import ThemeFile from '@/components/Tree/ThemeFile'
|
||||||
import { codemirror } from 'vue-codemirror-lite'
|
import { codemirror } from 'vue-codemirror-lite'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
codemirror
|
codemirror,
|
||||||
|
ThemeFile
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: 'Hello World'
|
files: [],
|
||||||
|
value: 'Hello world'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.loadFiles()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onSelect(keys) {
|
onSelect(keys) {
|
||||||
console.log('Trigger Select', keys)
|
console.log('Trigger Select', keys)
|
||||||
},
|
},
|
||||||
onExpand() {
|
onExpand() {
|
||||||
console.log('Trigger Expand')
|
console.log('Trigger Expand')
|
||||||
|
},
|
||||||
|
loadFiles() {
|
||||||
|
themeApi.listFiles().then(response => {
|
||||||
|
this.files = response.data.data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue