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/settings/PageSettingsPathParamsFormElement.vue
2024-10-14 08:47:26 +00:00

58 lines
1.4 KiB
Vue

<template>
<FormGroup small-label :label="$t('pageForm.pathParamsTitle')" required>
<div
v-for="pathParam in pathParams"
:key="pathParam.name"
class="page-settings-path-params"
>
<span class="page-settings-path-params__name">{{ pathParam.name }}</span>
<div class="page-settings-path-params__dropdown">
<Dropdown
:value="pathParam.type"
:disabled="disabled"
@input="$emit('update', pathParam.name, $event)"
>
<DropdownItem
v-for="pathParamType in pathParamTypes"
:key="pathParamType.getType()"
:name="pathParamType.name"
:value="pathParamType.getType()"
></DropdownItem>
</Dropdown>
</div>
</div>
<template #helper>
<template v-if="Object.keys(pathParams).length > 0">
{{ $t('pageForm.pathParamsSubtitle') }}
</template>
<template v-else>
{{ $t('pageForm.pathParamsSubtitleTutorial') }}
</template>
</template>
</FormGroup>
</template>
<script>
export default {
name: 'PageSettingsPathParamsFormElement',
props: {
pathParams: {
type: Array,
required: false,
default: () => [],
},
disabled: {
type: Boolean,
required: false,
default: false,
},
},
computed: {
pathParamTypes() {
return this.$registry.getOrderedList('pathParamType')
},
},
}
</script>