mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 00:08:25 +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>
48 lines
1.0 KiB
Vue
48 lines
1.0 KiB
Vue
<template>
|
|
<ButtonIcon
|
|
v-if="propertyModified()"
|
|
v-tooltip="$t('resetButton.reset')"
|
|
tooltip-position="bottom-left"
|
|
icon="iconoir-erase"
|
|
@click="resetProperty()"
|
|
/>
|
|
</template>
|
|
|
|
<script>
|
|
import _ from 'lodash'
|
|
|
|
export default {
|
|
inject: ['builder'],
|
|
props: {
|
|
value: { default: undefined, validator: (v) => true },
|
|
modelValue: { default: undefined, validator: (v) => true },
|
|
defaultValue: {
|
|
required: false,
|
|
validator: (v) => true,
|
|
default: undefined,
|
|
},
|
|
},
|
|
emits: ['input', 'update:modelValue'],
|
|
data() {
|
|
return {}
|
|
},
|
|
computed: {
|
|
currentValue() {
|
|
return this.modelValue !== undefined ? this.modelValue : this.value
|
|
},
|
|
},
|
|
methods: {
|
|
propertyModified() {
|
|
return (
|
|
this.defaultValue !== undefined &&
|
|
!_.isEqual(this.currentValue, this.defaultValue)
|
|
)
|
|
},
|
|
resetProperty() {
|
|
this.$emit('input', this.defaultValue)
|
|
this.$emit('update:modelValue', this.defaultValue)
|
|
},
|
|
},
|
|
}
|
|
</script>
|