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

tab.vue « tabs « 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: 1c6011dcfd0bcc952d6bdbaeb507310b7fb3108f (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 {
  props: {
    title: {
      type: String,
      required: false,
      default: '',
    },
    active: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
  data() {
    return {
      // props can't be updated, so we map it to data where we can
      localActive: this.active,
    };
  },
  watch: {
    active() {
      this.localActive = this.active;
    },
  },
  created() {
    this.isTab = true;
  },
  updated() {
    if (this.$parent) {
      this.$parent.$forceUpdate();
    }
  },
};
</script>

<template>
  <div
    :class="{
      active: localActive
    }"
    class="tab-pane"
    role="tabpanel"
  >
    <slot></slot>
  </div>
</template>