summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/repo/components/repo_tabs.vue
blob: 9c5bfc5d0cfad915674b5ada8d86fde4bac7ee70 (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
<script>
import Store from '../stores/repo_store';
import RepoTab from './repo_tab.vue';
import RepoMixin from '../mixins/repo_mixin';

const RepoTabs = {
  mixins: [RepoMixin],

  components: {
    'repo-tab': RepoTab,
  },

  data: () => Store,

  methods: {
    tabClosed(file) {
      Store.removeFromOpenedFiles(file);
    },
  },
};

export default RepoTabs;
</script>

<template>
<ul id="tabs">
  <repo-tab
    v-for="tab in openedFiles"
    :key="tab.id"
    :tab="tab"
    :class="{'active' : tab.active}"
    @tabclosed="tabClosed"
  />
  <li class="tabs-divider" />
</ul>
</template>