mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
Update the nuxt3 version. Co-authored-by: Jonathan Adeline <jonathan@baserow.io> Co-authored-by: Bram Wiepjes <bramw@protonmail.com> Co-authored-by: Cezary <cezary@baserow.io> Co-authored-by: Tsering Paljor <tsering@baserow.io> Co-authored-by: Przemyslaw Kukulski <przemyslaw+gh@baserow.io> Co-authored-by: Bram <bram2w@users.noreply.github.com>
56 lines
1.1 KiB
Vue
56 lines
1.1 KiB
Vue
<template>
|
|
<RadioGroup
|
|
:model-value="currentValue"
|
|
:options="options"
|
|
type="button"
|
|
@input="input"
|
|
/>
|
|
</template>
|
|
|
|
<script>
|
|
import { WIDTHS_NEW } from '@baserow/modules/builder/enums'
|
|
|
|
export default {
|
|
name: 'WidthSelector',
|
|
props: {
|
|
/**
|
|
* Vue 3 v-model value.
|
|
*/
|
|
modelValue: {
|
|
type: String,
|
|
default: undefined,
|
|
},
|
|
|
|
/**
|
|
* Vue 2 v-model value.
|
|
*/
|
|
value: {
|
|
type: String,
|
|
required: false,
|
|
default: WIDTHS_NEW.AUTO,
|
|
},
|
|
},
|
|
emits: ['input', 'update:modelValue'],
|
|
computed: {
|
|
// Prefer Vue 3 modelValue when defined.
|
|
currentValue() {
|
|
return this.modelValue !== undefined ? this.modelValue : this.value
|
|
},
|
|
options() {
|
|
return [
|
|
{ value: WIDTHS_NEW.AUTO, label: this.$t('widthSelector.widthAuto') },
|
|
{ value: WIDTHS_NEW.FULL, label: this.$t('widthSelector.widthFull') },
|
|
]
|
|
},
|
|
},
|
|
methods: {
|
|
input(value) {
|
|
// Vue 3 emit
|
|
this.$emit('update:modelValue', value)
|
|
// Vue 2 emit
|
|
this.$emit('input', value)
|
|
},
|
|
},
|
|
}
|
|
</script>
|