1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-22 15:52:34 +00:00
bramw_baserow/web-frontend/modules/builder/components/page/header/PageActions.vue
2024-05-02 14:25:42 +00:00

50 lines
1.3 KiB
Vue

<template>
<ul class="header__filter">
<template v-for="actionType in pageActionTypes">
<li
v-if="actionType.isActive({ page, workspace })"
:key="actionType.getType()"
class="header__filter-item header__filter-item--right"
>
<a
:ref="`button_${actionType.type}`"
class="header__filter-link"
@click="
actionType.onClick({
component: $refs[`component_${actionType.type}`][0],
button: $refs[`button_${actionType.type}`][0],
builder: builder,
page: page,
})
"
>
<i
v-if="actionType.icon"
class="header__filter-icon"
:class="actionType.icon"
></i>
<span class="header__filter-name">{{ actionType.label }}</span>
</a>
<component
:is="actionType.component"
:ref="`component_${actionType.type}`"
:builder="builder"
:page="page"
/>
</li>
</template>
</ul>
</template>
<script>
export default {
name: 'PageActions',
inject: ['workspace', 'builder', 'page'],
computed: {
pageActionTypes() {
return Object.values(this.$registry.getOrderedList('pageAction'))
},
},
}
</script>