qb1t
qb1t
Explore posts from servers
NNuxt
Created by qb1t on 11/17/2024 in #❓・help
NuxtUI v2 make primary color black
Hi I am using nuxt ui v2 in my project and I want my app to be light theme with black elements on it, but I am not able to change my primary color to just black (or any other color) I don't know what to do, it looks like if the ui library was just completely ignoring my app config. My debug app config that doesn't work: app.config.ts
export default defineAppConfig({
ui: {
primary: 'blue',
gray: 'cool'
},
});
export default defineAppConfig({
ui: {
primary: 'blue',
gray: 'cool'
},
});
Even with this the primary color is still green
6 replies
NNuxt
Created by qb1t on 2/4/2023 in #❓・help
Scroll to top when new page loads
How do I make nuxt scroll to top every time new page is visited? Right now I tried to make my own plugin but it doesn't work for some reason... (It doesn't even console log) scroll.js
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('page:finished', () => {
console.log("Scrolling to top");
window.scrollTo({
top: 0,
left: 0,
behavior: 'smooth'
});
})
});
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('page:finished', () => {
console.log("Scrolling to top");
window.scrollTo({
top: 0,
left: 0,
behavior: 'smooth'
});
})
});
44 replies
NNuxt
Created by qb1t on 1/20/2023 in #❓・help
Help with CORS
Hi so I need my website to load resources from an external api on client side Things I tried: using the built-in $fetch() method but I'm getting cors errors using the @nuxtjs/axios module but that doesn't even allow nuxt to start using normal axios and configuring it like this
import axios from 'axios'

const axiosInstance = axios.create({
baseURL: 'http://localhost:3001',
withCredentials: true,
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Accept, Content-Type, Authorization'
}
});

export default axiosInstance;
import axios from 'axios'

const axiosInstance = axios.create({
baseURL: 'http://localhost:3001',
withCredentials: true,
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Accept, Content-Type, Authorization'
}
});

export default axiosInstance;
I'm out of ideas what can I do?
3 replies