@@ -29,7 +29,7 @@ import { type QRCodeDocument } from '@/types/DBDocumentTypes'
|
||||
import { deliveryOptions } from '@/constants/deliveryOptions'
|
||||
|
||||
const emit = defineEmits(['nextStep'])
|
||||
const model = defineModel<QRCodeDocument['messageDeliveryMethod']>()
|
||||
const model = defineModel<null | QRCodeDocument['messageDeliveryMethod']>()
|
||||
|
||||
// Локальное состояние для уведомления
|
||||
const telegramNotice = ref(false)
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { qrCodePlacements } from '@/constants/qrCodePlacements'
|
||||
const selectedPlacement = defineModel<string>()
|
||||
import type { QRCodeDocument } from '@/types/DBDocumentTypes'
|
||||
const selectedPlacement = defineModel<null | QRCodeDocument['placement']>()
|
||||
|
||||
defineEmits(['nextStep'])
|
||||
</script>
|
||||
|
||||
@@ -35,7 +35,7 @@ import { type QRCodeDocument } from '@/types/DBDocumentTypes'
|
||||
import { defaultMessages } from '@/constants/defaultMessages'
|
||||
|
||||
// Пропсы
|
||||
const props = defineProps<{ placement: QRCodeDocument['placement'] }>()
|
||||
const props = defineProps<{ placement: null | QRCodeDocument['placement'] }>()
|
||||
const messagesRef = useTemplateRef<HTMLDivElement[]>('messagesRef')
|
||||
|
||||
// Локальное хранилище сообщений
|
||||
@@ -55,7 +55,7 @@ watch(
|
||||
messages.value.length === 0 ||
|
||||
JSON.stringify(messages.value) === JSON.stringify(prevDefaultMessages)
|
||||
if (isMessagesDefault) {
|
||||
messages.value = [...(defaultMessages[newPlacement] || [])]
|
||||
messages.value = [...(defaultMessages[newPlacement!] || [])]
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
|
||||
@@ -16,7 +16,11 @@ watch(
|
||||
() => sectionRef.value && props.isNextActiveSection,
|
||||
(isNextActiveSection) => {
|
||||
if (isNextActiveSection) {
|
||||
sectionRef.value?.querySelector('input[type="text"]')?.focus()
|
||||
const input = sectionRef.value?.querySelector('input[type="text"]')
|
||||
if (input instanceof HTMLInputElement) {
|
||||
input.focus()
|
||||
}
|
||||
|
||||
sectionRef.value?.scrollIntoView({ behavior: 'smooth' })
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user