summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_merge_request_widget/components/report_widget_container.vue
blob: ecf08f78f57bc445bc81e203a18859413f170d73 (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
<script>
export default {
  data() {
    return {
      hasChildren: false,
    };
  },
  updated() {
    this.hasChildren = this.checkSlots();
  },
  mounted() {
    this.hasChildren = this.checkSlots();
  },
  methods: {
    checkSlots() {
      return this.$scopedSlots.default?.()?.some((c) => c.tag);
    },
  },
};
</script>

<template>
  <div v-show="hasChildren" class="mr-section-container mr-widget-workflow">
    <slot></slot>
  </div>
</template>