mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
32 lines
757 B
Vue
32 lines
757 B
Vue
<template>
|
|
<div>
|
|
<slot v-if="canAccess" />
|
|
<slot v-else name="fallback" />
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { type PropType, defineComponent } from 'vue';
|
|
import type { EnterpriseEditionFeatureValue } from '@/Interface';
|
|
import { mapStores } from 'pinia';
|
|
import { useSettingsStore } from '@/stores/settings.store';
|
|
|
|
export default defineComponent({
|
|
name: 'EnterpriseEdition',
|
|
props: {
|
|
features: {
|
|
type: Array as PropType<EnterpriseEditionFeatureValue[]>,
|
|
default: () => [],
|
|
},
|
|
},
|
|
computed: {
|
|
...mapStores(useSettingsStore),
|
|
canAccess(): boolean {
|
|
return this.features.reduce((acc: boolean, feature) => {
|
|
return acc && !!this.settingsStore.isEnterpriseFeatureEnabled(feature);
|
|
}, true);
|
|
},
|
|
},
|
|
});
|
|
</script>
|