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>
63 lines
1.0 KiB
Vue
63 lines
1.0 KiB
Vue
<template>
|
|
<ButtonIcon
|
|
type="secondary"
|
|
v-bind="restProps"
|
|
:loading="loading"
|
|
:disabled="disabled"
|
|
:icon="icon"
|
|
:title="title"
|
|
:active="value"
|
|
@click.prevent="select()"
|
|
>
|
|
<slot></slot>
|
|
</ButtonIcon>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'SwitchButton',
|
|
props: {
|
|
value: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false,
|
|
},
|
|
loading: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false,
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false,
|
|
},
|
|
icon: {
|
|
type: String,
|
|
required: false,
|
|
default: '',
|
|
},
|
|
title: {
|
|
type: String,
|
|
required: false,
|
|
default: '',
|
|
},
|
|
},
|
|
emits: ['input'],
|
|
computed: {
|
|
restProps() {
|
|
const { value, modelValue, ...rest } = this.$attrs
|
|
return rest
|
|
},
|
|
},
|
|
methods: {
|
|
select() {
|
|
if (this.disabled) {
|
|
return
|
|
}
|
|
this.$emit('input', !this.value)
|
|
},
|
|
},
|
|
}
|
|
</script>
|