|
|
|
@ -14,7 +14,7 @@
|
|
|
|
depressed
|
|
|
|
depressed
|
|
|
|
:color='$vuetify.theme.dark ? `grey darken-4` : `blue darken-2`'
|
|
|
|
:color='$vuetify.theme.dark ? `grey darken-4` : `blue darken-2`'
|
|
|
|
style='flex: 1 1 100%;'
|
|
|
|
style='flex: 1 1 100%;'
|
|
|
|
@click='switchMode(`tree`)'
|
|
|
|
@click='switchMode(`browse`)'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
v-icon(left) mdi-file-tree
|
|
|
|
v-icon(left) mdi-file-tree
|
|
|
|
.body-2.text-none {{$t('common:sidebar.browse')}}
|
|
|
|
.body-2.text-none {{$t('common:sidebar.browse')}}
|
|
|
|
@ -70,8 +70,11 @@
|
|
|
|
v-icon(v-else-if="open") mdi-folder-open
|
|
|
|
v-icon(v-else-if="open") mdi-folder-open
|
|
|
|
v-icon(v-else) mdi-folder
|
|
|
|
v-icon(v-else) mdi-folder
|
|
|
|
template(v-slot:label="{ item }")
|
|
|
|
template(v-slot:label="{ item }")
|
|
|
|
div(class='tree-item' :class="{ 'tree-item-link': !item.children }")
|
|
|
|
a.d-flex.align-center(
|
|
|
|
a(v-if="!item.children" :href="'/'+item.locale+'/'+item.path" class='tree-item-link')
|
|
|
|
v-if="!item.children"
|
|
|
|
|
|
|
|
:href="'/'+item.locale+'/'+item.path"
|
|
|
|
|
|
|
|
style="width: 100%; text-decoration: none; color: inherit;"
|
|
|
|
|
|
|
|
)
|
|
|
|
span {{item.name}}
|
|
|
|
span {{item.name}}
|
|
|
|
span(v-else) {{item.name}}
|
|
|
|
span(v-else) {{item.name}}
|
|
|
|
|
|
|
|
|
|
|
|
@ -320,7 +323,7 @@ export default {
|
|
|
|
this.treeItems = children.map(item => this.pageItem2TreeItem(item, 0))
|
|
|
|
this.treeItems = children.map(item => this.pageItem2TreeItem(item, 0))
|
|
|
|
this.checkTreeDefaultOpen(this.treeItems, 0)
|
|
|
|
this.checkTreeDefaultOpen(this.treeItems, 0)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async checkTreeDefaultOpen(items) {
|
|
|
|
checkTreeDefaultOpen(items) {
|
|
|
|
const item = items.find(item => item.children && this.path.startsWith(item.path))
|
|
|
|
const item = items.find(item => item.children && this.path.startsWith(item.path))
|
|
|
|
if (item) {
|
|
|
|
if (item) {
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
@ -365,11 +368,12 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.navMode === 'STATIC') {
|
|
|
|
if (this.navMode === 'STATIC') {
|
|
|
|
this.currentMode = 'custom'
|
|
|
|
this.currentMode = 'custom'
|
|
|
|
// } else if (this.navMode === 'NEWTREE') {
|
|
|
|
} else if (this.navMode === 'NEWTREE') {
|
|
|
|
// this.currentMode = 'tree'
|
|
|
|
this.currentMode = 'tree'
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.currentMode = window.localStorage.getItem('navPref') || 'custom'
|
|
|
|
this.currentMode = window.localStorage.getItem('navPref') || 'custom'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this.currentMode === 'browse') {
|
|
|
|
if (this.currentMode === 'browse') {
|
|
|
|
this.loadFromCurrentPath()
|
|
|
|
this.loadFromCurrentPath()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -381,63 +385,25 @@ export default {
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
|
|
|
|
.v-treeview {
|
|
|
|
.v-treeview {
|
|
|
|
.tree-item {
|
|
|
|
.v-treeview-node {
|
|
|
|
width: 100%;
|
|
|
|
&__root {
|
|
|
|
padding: 8px 0;
|
|
|
|
padding: 0;
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
|
|
line-height: 1rem;
|
|
|
|
|
|
|
|
font-size: 1rem;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tree-item-link {
|
|
|
|
&__content {
|
|
|
|
display: block;
|
|
|
|
margin: 0;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
color: inherit;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.tree-item-link a {
|
|
|
|
a {
|
|
|
|
display: block;
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
padding: 8px 16px;
|
|
|
|
padding: 8px 16px;
|
|
|
|
margin: -8px 0;
|
|
|
|
|
|
|
|
text-decoration: none;
|
|
|
|
text-decoration: none;
|
|
|
|
color: inherit;
|
|
|
|
color: inherit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//.tree-item {
|
|
|
|
|
|
|
|
// width: 100%;
|
|
|
|
|
|
|
|
// padding: 8px 0;
|
|
|
|
|
|
|
|
// font-weight: 500;
|
|
|
|
|
|
|
|
// line-height: 1rem;
|
|
|
|
|
|
|
|
// font-size: 0.8rem;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//.tree-item-link {
|
|
|
|
|
|
|
|
// display: block;
|
|
|
|
|
|
|
|
// width: 100%;
|
|
|
|
|
|
|
|
// text-decoration: none;
|
|
|
|
|
|
|
|
// color: inherit;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//.tree-item-link a {
|
|
|
|
|
|
|
|
// display: block;
|
|
|
|
|
|
|
|
// width: 100%;
|
|
|
|
|
|
|
|
// padding: 8px 16px;
|
|
|
|
|
|
|
|
// margin: -8px 0;
|
|
|
|
|
|
|
|
// text-decoration: none;
|
|
|
|
|
|
|
|
// color: inherit;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//a {
|
|
|
|
|
|
|
|
// text-decoration: none;
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
//&.theme--dark{
|
|
|
|
|
|
|
|
// a {
|
|
|
|
|
|
|
|
// color: white;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|