debian-mirror-gitlab/app/assets/javascripts/ide/components/repo_tabs.vue

47 lines
905 B
Vue
Raw Normal View History

2018-05-09 12:01:36 +05:30
<script>
import { mapActions } from 'vuex';
import RepoTab from './repo_tab.vue';
export default {
components: {
RepoTab,
},
props: {
activeFile: {
type: Object,
required: true,
},
files: {
type: Array,
required: true,
},
viewer: {
type: String,
required: true,
},
},
methods: {
...mapActions(['updateViewer', 'removePendingTab']),
openFileViewer(viewer) {
this.updateViewer(viewer);
if (this.activeFile.pending) {
return this.removePendingTab(this.activeFile).then(() => {
2020-06-23 00:09:42 +05:30
this.$router.push(`/project${this.activeFile.url}`);
2018-05-09 12:01:36 +05:30
});
}
return null;
},
},
};
</script>
<template>
<div class="multi-file-tabs">
2020-06-23 00:09:42 +05:30
<ul ref="tabsScroller" class="list-unstyled gl-mb-0">
2019-02-15 15:39:39 +05:30
<repo-tab v-for="tab in files" :key="tab.key" :tab="tab" />
2018-05-09 12:01:36 +05:30
</ul>
</div>
</template>