TheDreWen
TheDreWen
NNuxt
Created by TheDreWen on 12/6/2024 in #❓・help
smooth scrollbar for NuxtJs
Hello, how can I use https://github.com/idiotWu/smooth-scrollbar For Nuxt 3
4 replies
NNuxt
Created by TheDreWen on 12/6/2024 in #❓・help
Generate SiteMap with api and Nuxt/sitemap
Hello I have an api that gives objects containing various company names, I use nuxt/sitemap but I do not understand how to add these dinamics urls (/stocks/company symbol) to sitemap.xml.
16 replies
NNuxt
Created by TheDreWen on 12/3/2024 in #❓・help
Nuxt Electron ERR_TOO_MANY_REDIRECTS
Hello I use nuxt-electron but when the application opens I get this error and nothing loads: node:3644) electron: Failed to load URL: http://localhost:3000/ with error: ERR_TOO_MANY_REDIRECTS
7 replies
NNuxt
Created by TheDreWen on 11/24/2024 in #❓・help
Get SSE data from nuxt
I've written this code to retrieve SSE data, but it doesn't work properly.
// autre
const output = ref<String>("");

onMounted(() => {
const event = new EventSource(api_url+"projects/"+project_id+"/console?token="+useCookie("X-auth").value)

event.addEventListener("message", (e) => {
console.log(e);
output.value += e.data;
});
});
// autre
const output = ref<String>("");

onMounted(() => {
const event = new EventSource(api_url+"projects/"+project_id+"/console?token="+useCookie("X-auth").value)

event.addEventListener("message", (e) => {
console.log(e);
output.value += e.data;
});
});
5 replies
NNuxt
Created by TheDreWen on 11/23/2024 in #❓・help
Global import of css files, but no.
Hello, I have a problem with the css files I import with <style scoped> @import.... </style> My css files are also present in the other pages.
15 replies
NNuxt
Created by TheDreWen on 11/6/2024 in #❓・help
How do I pass a variable from the middleware to my page?
import { api_url } from "~/src/variables";

export default defineNuxtRouteMiddleware(async (to, from) => {
const {data, error} = await useFetch<{ connected: boolean, user: {email: string, root: boolean, username: string, user_id: number} }>(api_url+"check-session");
if(!data.value?.connected){
return navigateTo("/");
}else{
// Pass variable
}
});
import { api_url } from "~/src/variables";

export default defineNuxtRouteMiddleware(async (to, from) => {
const {data, error} = await useFetch<{ connected: boolean, user: {email: string, root: boolean, username: string, user_id: number} }>(api_url+"check-session");
if(!data.value?.connected){
return navigateTo("/");
}else{
// Pass variable
}
});
44 replies