FoxForGate
FoxForGate
NNuxt
Created by HardWare on 11/14/2024 in #❓・help
Docker nuxt $fetch and useFetch
Hello, how are you?, to help organize multiple APIs I created a module, see if it solves your problem https://www.npmjs.com/package/nuxt-http-preset
11 replies
NNuxt
Created by FoxForGate on 10/27/2024 in #❓・help
How to add my module to the nuxt module list
6 replies
NNuxt
Created by FoxForGate on 9/13/2024 in #❓・help
Error in the NuxtPDF module
Later I will fork the original project and try to fix this problem, but I don't know if the fix will be implemented because analyzing the project's github it is inactive
15 replies
NNuxt
Created by FoxForGate on 9/13/2024 in #❓・help
Error in the NuxtPDF module
this was the only way to use it, I believe there is some part of the code that when using "exportToPDF" tries to manipulate something on the client, without checking whether the process is occurring on the client side
15 replies
NNuxt
Created by FoxForGate on 9/13/2024 in #❓・help
Error in the NuxtPDF module
<template>
<UCard >
<div class="h-full space-y-5">
<div ref="pdfSection" class="bg-white h-full">
<p class="text-gray-900">{{ props.data }}</p>
</div>
<UButton @click="createPDF(pdfSection as HTMLElement)" size="lg" label="Baixar PDF" block />
</div>
</UCard>
</template>
<script setup lang="ts">

const pdfSection = ref<HTMLElement | null>(null)

interface Props {
data: any,
}

const props = defineProps<Props>()

const createPDF = async(HTMLElement: HTMLElement) => {
if(HTMLElement){
exportToPDF('pdf_protected_export.pdf', HTMLElement,
{
encryption: {
ownerPassword: 'test',
userPassword: 'test2',
userPermissions: ['print']
}
}, {
html2canvas: {
scale: 0.7,
useCORS: true
}
})
}

}
</script>
<template>
<UCard >
<div class="h-full space-y-5">
<div ref="pdfSection" class="bg-white h-full">
<p class="text-gray-900">{{ props.data }}</p>
</div>
<UButton @click="createPDF(pdfSection as HTMLElement)" size="lg" label="Baixar PDF" block />
</div>
</UCard>
</template>
<script setup lang="ts">

const pdfSection = ref<HTMLElement | null>(null)

interface Props {
data: any,
}

const props = defineProps<Props>()

const createPDF = async(HTMLElement: HTMLElement) => {
if(HTMLElement){
exportToPDF('pdf_protected_export.pdf', HTMLElement,
{
encryption: {
ownerPassword: 'test',
userPassword: 'test2',
userPermissions: ['print']
}
}, {
html2canvas: {
scale: 0.7,
useCORS: true
}
})
}

}
</script>
this is my component responsible for the PDF
<ClientOnly>
<PerfilPreviewCurriculo :data="data"/>
</ClientOnly>
<ClientOnly>
<PerfilPreviewCurriculo :data="data"/>
</ClientOnly>
and in this way I use it
15 replies
NNuxt
Created by FoxForGate on 9/13/2024 in #❓・help
Error in the NuxtPDF module
I took a better look at the error and looked in the module files to see how it works, the problem is that it works with "jspdf" which does not support the use of SSR, which caused it to try to manipulate information that is part of of the client, in this case the HTMLElement. To resolve this error, I created an isolated component to work only with my PDF and the html related to it and when using it I placed it inside a "ClientOnly" thus resolving the error in question
15 replies
NNuxt
Created by FoxForGate on 9/13/2024 in #❓・help
Error in the NuxtPDF module
15 replies
NNuxt
Created by FoxForGate on 9/13/2024 in #❓・help
Error in the NuxtPDF module
I couldn't, I tried to look through the documentation but the page that was supposed to be the documentation is getting a 404
15 replies
NNuxt
Created by FoxForGate on 7/26/2024 in #❓・help
Is it possible to use a custom icon in NuxtUI "<UIcon />"?
I'm currently using it this way, but I was wondering if it wasn't possible to simply add new icons
4 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
I've never had this kind of problem, but I'll try to help
38 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
thanks
38 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
the image you sent previously only has the statusMessage, can you send it showing the message so we can see the erro
38 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
ahhh agora sim entendi
38 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
sim como eu disse, voce pode alterar a informação, porem ela tem como objetivo ser um indicativo, um curto texto de uma ou duas palavras, não é correto utilizar ele para passar a informação que vai ser exibida para o usuário, para este objetivo pode se utilizar "data", ou "message"
38 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
38 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
because there are cases in which you create internal status codes, I have already worked with APIs of this type, for example, it can return an 809 code, however this does not exist in our official http response list, for this reason you would have to create a statusMessage for the same
38 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
yes, you can return "data", this being a parameter accepted by createError(), and in it you can pass an object with information, such as the error message in Portuguese
38 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
If I'm not mistaken, you can just pass "status Code" and it will automatically set the statusMessage according to
38 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
The problem is that "statusMessage" is reserved for the message related to the error code, so for example, if you use the 401 code, the correct thing is for your statusMessage to be "Unauthorized", texts of the statusMessage type do not support accentuation, for this reason this problem is occurring, try using the statusMessage according to your codeStatus, or do not use accents in it
38 replies
NNuxt
Created by Medim on 5/7/2024 in #❓・help
Encoding a bit off on createError?
olha um BR aqui, vou lhe enviar a mensagem em ingles para a galera poder entender tmb kkk
38 replies