debian-mirror-gitlab/app/assets/javascripts/repository/pages/tree.vue

39 lines
688 B
Vue
Raw Normal View History

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';
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
},
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>
2019-12-26 22:10:19 +05:30
<tree-content :path="path" />
2019-09-04 21:01:54 +05:30
</template>