mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
60 lines
923 B
Vue
60 lines
923 B
Vue
|
<template>
|
||
|
<n8n-menu
|
||
|
:items="menuItems"
|
||
|
mode="tabs"
|
||
|
:value="value ? 'owner' : 'all'"
|
||
|
@input="onSelectOwner"
|
||
|
/>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
import Vue from 'vue';
|
||
|
import { IMenuItem } from 'n8n-design-system';
|
||
|
|
||
|
export default Vue.extend({
|
||
|
props: {
|
||
|
value: {
|
||
|
type: Boolean,
|
||
|
default: true,
|
||
|
},
|
||
|
myResourcesLabel: {
|
||
|
type: String,
|
||
|
default: '',
|
||
|
},
|
||
|
allResourcesLabel: {
|
||
|
type: String,
|
||
|
default: '',
|
||
|
},
|
||
|
},
|
||
|
computed: {
|
||
|
menuItems(): IMenuItem[] {
|
||
|
return [
|
||
|
{
|
||
|
id: 'owner',
|
||
|
icon: 'user',
|
||
|
label: this.myResourcesLabel,
|
||
|
position: 'top',
|
||
|
},
|
||
|
{
|
||
|
id: 'all',
|
||
|
icon: 'globe-americas',
|
||
|
label: this.allResourcesLabel,
|
||
|
position: 'top',
|
||
|
},
|
||
|
];
|
||
|
},
|
||
|
},
|
||
|
methods: {
|
||
|
onSelectOwner(type: string) {
|
||
|
this.$emit('input', type === 'owner');
|
||
|
},
|
||
|
},
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped>
|
||
|
.menu-container {
|
||
|
--menu-padding: 0;
|
||
|
}
|
||
|
</style>
|