2019-05-20 04:41:28 -04:00
|
|
|
<script>
|
2019-11-07 13:06:21 -05:00
|
|
|
import TreeContent from '../components/tree_content.vue';
|
2019-11-12 13:06:57 -05:00
|
|
|
import { updateElementsVisibility } from '../utils/dom';
|
2020-01-14 10:07:55 -05:00
|
|
|
import preloadMixin from '../mixins/preload';
|
2019-05-16 04:18:52 -04:00
|
|
|
|
2019-05-20 04:41:28 -04:00
|
|
|
export default {
|
2019-05-21 09:26:18 -04:00
|
|
|
components: {
|
2019-11-07 13:06:21 -05:00
|
|
|
TreeContent,
|
2019-05-16 04:18:52 -04:00
|
|
|
},
|
2020-01-14 10:07:55 -05:00
|
|
|
mixins: [preloadMixin],
|
2019-05-20 04:41:28 -04:00
|
|
|
props: {
|
|
|
|
path: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '/',
|
|
|
|
},
|
|
|
|
},
|
2019-11-12 13:06:57 -05:00
|
|
|
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-05-20 04:41:28 -04:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2020-01-14 10:07:55 -05:00
|
|
|
<tree-content :path="path" :loading-path="loadingPath" />
|
2019-05-20 04:41:28 -04:00
|
|
|
</template>
|