2019-09-04 21:01:54 +05:30
|
|
|
<script>
|
2019-12-26 22:10:19 +05:30
|
|
|
import TreeContent from '../components/tree_content.vue';
|
|
|
|
import { updateElementsVisibility } from '../utils/dom';
|
2020-03-09 13:42:32 +05:30
|
|
|
import preloadMixin from '../mixins/preload';
|
2019-09-04 21:01:54 +05:30
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2019-12-26 22:10:19 +05:30
|
|
|
TreeContent,
|
2019-09-04 21:01:54 +05:30
|
|
|
},
|
2020-03-09 13:42:32 +05:30
|
|
|
mixins: [preloadMixin],
|
2019-09-04 21:01:54 +05:30
|
|
|
props: {
|
|
|
|
path: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '/',
|
|
|
|
},
|
|
|
|
},
|
2019-12-26 22:10:19 +05:30
|
|
|
computed: {
|
|
|
|
isRoot() {
|
|
|
|
return this.path === '/';
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
isRoot: {
|
|
|
|
immediate: true,
|
|
|
|
handler: 'updateElements',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
updateElements(isRoot) {
|
|
|
|
updateElementsVisibility('.js-show-on-root', isRoot);
|
|
|
|
updateElementsVisibility('.js-hide-on-root', !isRoot);
|
|
|
|
},
|
|
|
|
},
|
2019-09-04 21:01:54 +05:30
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2020-03-09 13:42:32 +05:30
|
|
|
<tree-content :path="path" :loading-path="loadingPath" />
|
2019-09-04 21:01:54 +05:30
|
|
|
</template>
|