aboutsummaryrefslogtreecommitdiff
path: root/resources/vue/apps/ContentBar.vue
blob: 8b8aa5d906d38ff741b8b2e69e538a60830326aa (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
<script>
import { h } from 'vue';
import ContentBar from '@/vue/components/ContentBar.vue';
import ContentBarBreadcrumbs from '@/vue/components/ContentBarBreadcrumbs.vue';

export default {
    props: ['icon', 'isContentBar', 'toc'],
    setup(props, context) {
        return () =>
            h(
                ContentBar,
                {
                    icon: props.icon,
                    isContentBar: props.isContentBar,
                    toc: props.toc,
                },
                props.toc ? {
                    'breadcrumb-list': () => h(ContentBarBreadcrumbs, { toc: props.toc }),
                    ...context.slots,
                } : {},
            );
    },
    mounted() {
        window.STUDIP.eventBus.emit('courseware-contentbar-mounted', this);
    }
};
</script>