add PromotionModal.vue
All checks were successful
Deploy / build (push) Successful in 1m2s

This commit is contained in:
alsaze
2025-12-16 13:56:22 +03:00
parent 62a319ca47
commit 2b276c0c16
6 changed files with 166 additions and 5 deletions

View File

@@ -132,13 +132,15 @@
</template>
<script setup lang="ts">
import { useSessionStorage } from '@vueuse/core'
const toast = useToast()
const route = useRoute()
const contacts = [
{
label: 'Телефон',
value: '+9 (967) 001-15-500',
value: '+9 (965) 042-80-490',
icon: 'i-lucide:phone',
},
{
@@ -162,11 +164,21 @@ const services = [
'аренда недвижимости',
]
const state = useSessionStorage('contacts', {
contacts:
{
name: '',
phone: '',
service: '',
comment: '',
},
})
const { errors, handleSubmit, defineField } = useForm({
initialValues: {
name: '',
phone: '',
service: '',
service: state?.value?.contacts?.service || '',
comment: '',
},
validationSchema: {
@@ -216,6 +228,11 @@ const onSubmit = handleSubmit(async (values) => {
})
}
})
watch(() => state.value, () => {
if (state.value.contacts.service)
service.value = state.value.contacts.service
})
</script>
<style lang="scss">