flaschengeist-frontend/src/components/navigation/ShortCutLink.vue

30 lines
610 B
Vue
Raw Normal View History

<template>
<q-btn flat dense :icon="icon" :to="{ name: link }" v-if="isGranted" />
</template>
<script lang="ts">
import { computed, defineComponent } from 'vue';
import { hasPermissions } from 'src/utils/permission';
export default defineComponent({
name: 'ShortCutLink',
props: {
link: {
required: true,
type: String,
},
icon: {
required: true,
type: String,
2020-10-31 18:33:05 +00:00
},
permissions: {
default: undefined,
},
2020-10-31 18:33:05 +00:00
},
setup(props) {
const isGranted = computed(() => hasPermissions(props.permissions || []));
return { isGranted };
},
});
</script>