Welcome to mirror list, hosted at ThFree Co, Russian Federation.

file_tree.vue « components « vue_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e7817b8f9108c58c02a01cc56d46e9b7d3dcc410 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<script>
export default {
  name: 'FileTree',
  props: {
    fileRowComponent: {
      type: Object,
      required: true,
    },
    level: {
      type: Number,
      required: true,
    },
    file: {
      type: Object,
      required: true,
    },
  },
  computed: {
    childFilesLevel() {
      return this.file.isHeader ? 0 : this.level + 1;
    },
  },
};
</script>

<template>
  <div>
    <component
      :is="fileRowComponent"
      :level="level"
      :file="file"
      v-bind="$attrs"
      v-on="$listeners"
    />
    <template v-if="file.opened || file.isHeader">
      <file-tree
        v-for="childFile in file.tree"
        :key="childFile.key"
        :file-row-component="fileRowComponent"
        :level="childFilesLevel"
        :file="childFile"
        v-bind="$attrs"
        v-on="$listeners"
      />
    </template>
  </div>
</template>