fix: Corregir nombres de componentes para auto-import de Nuxt
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:
2025-11-26 17:34:10 -06:00
parent 413ec6d27e
commit 1027e1ece6
2 changed files with 9 additions and 7 deletions

View File

@@ -5,11 +5,11 @@ import { usePreview, CHAR_LIMITS } from '~/composables/usePreview'
const props = defineProps<{ const props = defineProps<{
template: PrintTemplate | null template: PrintTemplate | null
modelValue: boolean open: boolean
}>() }>()
const emit = defineEmits<{ const emit = defineEmits<{
'update:modelValue': [value: boolean] 'update:open': [value: boolean]
'print': [operations: Operation[], variables: Record<string, string>] 'print': [operations: Operation[], variables: Record<string, string>]
}>() }>()
@@ -27,7 +27,7 @@ const variables = computed(() => {
}) })
// Inicializar preview cuando se abre el modal // Inicializar preview cuando se abre el modal
watch(() => props.modelValue, (isOpen) => { watch(() => props.open, (isOpen) => {
if (isOpen && props.template) { if (isOpen && props.template) {
// Inicializar valores de variables con defaults // Inicializar valores de variables con defaults
const initialValues: Record<string, string> = {} const initialValues: Record<string, string> = {}
@@ -73,7 +73,7 @@ function handleKeydown(event: KeyboardEvent) {
// Cerrar modal // Cerrar modal
function closeModal() { function closeModal() {
emit('update:modelValue', false) emit('update:open', false)
} }
// Imprimir // Imprimir
@@ -99,8 +99,10 @@ const previewInfo = computed(() => {
<template> <template>
<UModal <UModal
:model-value="modelValue" :open="open"
@update:model-value="$emit('update:modelValue', $event)" @update:open="$emit('update:open', $event)"
title="Vista Previa"
:description="template?.name || ''"
:ui="{ :ui="{
width: 'max-w-2xl' width: 'max-w-2xl'
}" }"

View File

@@ -150,7 +150,7 @@ async function handlePrintFromPreview(operations: Operation[], variables: Record
<!-- Modal de vista previa --> <!-- Modal de vista previa -->
<PreviewModal <PreviewModal
v-model="previewModalOpen" v-model:open="previewModalOpen"
:template="previewTemplate" :template="previewTemplate"
@print="handlePrintFromPreview" @print="handlePrintFromPreview"
/> />