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/DeviceSelector.vue
2024-06-13 12:45:52 +00:00

43 lines
978 B
Vue

<template>
<div class="device-selector">
<div
v-for="(deviceType, index) in deviceTypes"
:key="index"
class="device-selector__item"
:class="`device-selector__item--${direction}`"
>
<RadioButton
:key="deviceType.getType()"
:value="deviceType.getType()"
:icon="deviceType.iconClass"
:model-value="deviceTypeSelected"
class="device-selector__button"
@click.native="$emit('selected', deviceType.getType())"
></RadioButton>
<slot name="deviceTypeControl" :device-type="deviceType"></slot>
</div>
</div>
</template>
<script>
export default {
name: 'DeviceSelector',
props: {
deviceTypeSelected: {
type: String,
required: true,
},
direction: {
type: String,
required: false,
default: 'column',
},
},
computed: {
deviceTypes() {
return Object.values(this.$registry.getOrderedList('device'))
},
},
}
</script>