-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettingsForm.vue
More file actions
45 lines (42 loc) · 1.51 KB
/
SettingsForm.vue
File metadata and controls
45 lines (42 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<template>
<v-form @submit.prevent="emit('save')">
<v-card :width="width < 400 ? 350 : 400" class="mx-auto mt-3 mb-3">
<v-card-title class="text-h5">
העדפות התראות
</v-card-title>
<v-switch v-model="settings.enableEmailNotifications" label="קבלת מאמרים מפידים במעקב ישירות למייל" class="mx-5" color="green" />
<v-switch v-model="settings.allowAttachmentsInEmail" label="אפשר שליחת תמונת מאמר כקובץ מצורף" class="mx-5" color="green" />
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green" :variant="props.hasChanges ? 'outlined' : 'text'" type="submit" :loading="props.loadingSaveSettings">
שמירה
</v-btn>
</v-card-actions>
</v-card>
</v-form>
</template>
<script setup>
import { ref, watch } from 'vue';
import { useDisplay } from 'vuetify';
const { width } = useDisplay();
const props = defineProps({
initialSettings: {
type: Object,
required: true
},
loadingSaveSettings: {
type: Boolean,
required: true,
},
hasChanges: {
type: Boolean,
required: true
}
})
const settings = ref({ ...props.initialSettings })
const emit = defineEmits(['changeSettings', 'save'])
watch(settings, (newSettings) => {
emit('changeSettings', newSettings);
}, { deep: true })
</script>