mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
* feat(frontend): migration fixes * feat(admin): post migration fixes * feat(admin): revert docker change * feat(admin): update tests
53 lines
1.0 KiB
Vue
53 lines
1.0 KiB
Vue
<template>
|
|
<BFormGroup :label="label" :label-for="idName">
|
|
<BFormInput :id="idName" :model-value="modelValue" @update:model-value="inputValue = $event" />
|
|
</BFormGroup>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'EditableGroupableLabel',
|
|
props: {
|
|
modelValue: {
|
|
type: String,
|
|
required: false,
|
|
default: null,
|
|
},
|
|
label: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
idName: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
},
|
|
emits: ['update:model-value'],
|
|
data() {
|
|
return {
|
|
inputValue: this.modelValue,
|
|
originalValue: this.modelValue,
|
|
}
|
|
},
|
|
watch: {
|
|
inputValue() {
|
|
this.updateValue()
|
|
},
|
|
},
|
|
methods: {
|
|
updateValue() {
|
|
if (this.inputValue !== this.originalValue) {
|
|
if (this.$parent.valueChanged) {
|
|
this.$parent.valueChanged()
|
|
}
|
|
} else {
|
|
if (this.$parent.invalidValues) {
|
|
this.$parent.invalidValues()
|
|
}
|
|
}
|
|
this.$emit('update:model-value', this.inputValue)
|
|
},
|
|
},
|
|
}
|
|
</script>
|