mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 16:28:31 +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>
36 lines
773 B
Vue
36 lines
773 B
Vue
<template>
|
|
<div class="control__elements">
|
|
<div
|
|
class="field-boolean__checkbox"
|
|
:class="{ active: value, 'field-boolean__checkbox--disabled': readOnly }"
|
|
@click="toggle(value)"
|
|
>
|
|
<i class="iconoir-check check field-boolean__checkbox-icon"></i>
|
|
</div>
|
|
<div v-show="touched && !valid" class="error">
|
|
{{ error }}
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import rowEditField from '@baserow/modules/database/mixins/rowEditField'
|
|
|
|
export default {
|
|
mixins: [rowEditField],
|
|
emits: ['update'],
|
|
methods: {
|
|
toggle(value) {
|
|
if (this.readOnly) {
|
|
return
|
|
}
|
|
|
|
const oldValue = !!value
|
|
const newValue = !value
|
|
this.$emit('update', newValue, oldValue)
|
|
this.touch()
|
|
},
|
|
},
|
|
}
|
|
</script>
|