fix: Corregir nombres de componentes para auto-import de Nuxt
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 36s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 36s
- Cambiar prop modelValue a open para UModal - Usar PreviewPaperSimulator en vez de PaperSimulator - Usar PreviewModal en vez de PreviewPreviewModal
This commit is contained in:
@@ -5,11 +5,11 @@ import { usePreview, CHAR_LIMITS } from '~/composables/usePreview'
|
||||
|
||||
const props = defineProps<{
|
||||
template: PrintTemplate | null
|
||||
modelValue: boolean
|
||||
open: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: boolean]
|
||||
'update:open': [value: boolean]
|
||||
'print': [operations: Operation[], variables: Record<string, string>]
|
||||
}>()
|
||||
|
||||
@@ -27,7 +27,7 @@ const variables = computed(() => {
|
||||
})
|
||||
|
||||
// Inicializar preview cuando se abre el modal
|
||||
watch(() => props.modelValue, (isOpen) => {
|
||||
watch(() => props.open, (isOpen) => {
|
||||
if (isOpen && props.template) {
|
||||
// Inicializar valores de variables con defaults
|
||||
const initialValues: Record<string, string> = {}
|
||||
@@ -73,7 +73,7 @@ function handleKeydown(event: KeyboardEvent) {
|
||||
|
||||
// Cerrar modal
|
||||
function closeModal() {
|
||||
emit('update:modelValue', false)
|
||||
emit('update:open', false)
|
||||
}
|
||||
|
||||
// Imprimir
|
||||
@@ -99,8 +99,10 @@ const previewInfo = computed(() => {
|
||||
|
||||
<template>
|
||||
<UModal
|
||||
:model-value="modelValue"
|
||||
@update:model-value="$emit('update:modelValue', $event)"
|
||||
:open="open"
|
||||
@update:open="$emit('update:open', $event)"
|
||||
title="Vista Previa"
|
||||
:description="template?.name || ''"
|
||||
:ui="{
|
||||
width: 'max-w-2xl'
|
||||
}"
|
||||
|
||||
@@ -150,7 +150,7 @@ async function handlePrintFromPreview(operations: Operation[], variables: Record
|
||||
|
||||
<!-- Modal de vista previa -->
|
||||
<PreviewModal
|
||||
v-model="previewModalOpen"
|
||||
v-model:open="previewModalOpen"
|
||||
:template="previewTemplate"
|
||||
@print="handlePrintFromPreview"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user