Added vuelidator to the project, implemented update of Employeeprofile
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { ref } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
import { toRef } from 'vue'
|
||||
|
||||
const isActive : Ref<boolean> = ref(false)
|
||||
|
||||
const props = defineProps(['isActive'])
|
||||
const emit = defineEmits(['save', 'toggleEdit'])
|
||||
|
||||
const isActive = toRef(props, 'isActive')
|
||||
|
||||
function onEdit() {
|
||||
isActive.value = true
|
||||
emit('toggleEdit')
|
||||
}
|
||||
|
||||
function onSave() {
|
||||
|
||||
emit('save')
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
isActive.value = false
|
||||
emit('toggleEdit')
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -28,12 +31,12 @@ function onCancel() {
|
||||
|
||||
<button v-if="!isActive" type="button" @click="onEdit" class="btn btn-primary ms-auto">
|
||||
<i class="bi bi-pen"></i>
|
||||
Bearbeiten
|
||||
Mitarbeiter bearbeiten
|
||||
</button>
|
||||
|
||||
<button v-if="isActive" type="button" @click="onSave" class="btn btn-success ms-auto">
|
||||
<i class="bi bi-save"></i>
|
||||
Speichern
|
||||
Mitarbeiter speichern
|
||||
</button>
|
||||
|
||||
<button v-if="isActive" type="button" @click="onCancel" class="btn btn-outline-secondary ms-3">
|
||||
|
||||
Reference in New Issue
Block a user