debian-mirror-gitlab/app/assets/javascripts/repository/pages/tree.vue
2019-12-26 22:10:19 +05:30

38 lines
688 B
Vue

<script>
import TreeContent from '../components/tree_content.vue';
import { updateElementsVisibility } from '../utils/dom';
export default {
components: {
TreeContent,
},
props: {
path: {
type: String,
required: false,
default: '/',
},
},
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);
},
},
};
</script>
<template>
<tree-content :path="path" />
</template>