summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/repo/components/repo_tabs.vue
blob: 841aa6895943df8502ade4a86da1ecac29e3e4d7 (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
<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"
    v-if="isMini">
  <repo-tab
    v-for="tab in openedFiles"
    :key="tab.id"
    :tab="tab"
    :class="{'active' : tab.active}"
    @tabclosed="tabClosed"
  />
  <li class="tabs-divider" />
</ul>
</template>