Files
baserow/web-frontend/modules/builder/components/settings/mixins/builderSetting.js
716d43a9a8 Nuxt 3 migration (#4342)
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>
2026-01-22 10:27:19 +01:00

44 lines
907 B
JavaScript

/**
* A mixin for the builder setting components which have forms. This mixin makes
* it easier to make them immediately display their "create" form from the parent
* builder settings modal. When `force-display-form` is set, the end-user doesn't
* have to click a "New" button.
*/
export default {
emits: ['hide-modal'],
props: {
builder: {
type: Object,
required: true,
},
forceDisplayForm: {
type: Boolean,
required: false,
default: false,
},
hideAfterCreate: {
type: Boolean,
required: false,
default: false,
},
},
data() {
return {
showForm: false,
}
},
mounted() {
if (this.forceDisplayForm) {
this.showForm = true
}
},
methods: {
hideModalIfRequired(createdRecordId) {
if (this.hideAfterCreate) {
this.$emit('hide-modal', createdRecordId)
}
},
},
}