-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nuxt3 Support #9
Comments
Hello! Any help? |
@pisandelli Did you ever figure this out? What is not working exactly? For me, I get a 404. |
This plugin can not work with nuxt3 since it uses We have to create a nuxt3 module which injects tags inside the nuxt |
Hey @rwwagner90 for me the fonts are not being added. Thanks for @stafyniaksacha for clarifying this issue. |
I just manually added my fonts to the |
For nuxt and google font you can use this: import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
app: {
head: {
link: [
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
{
rel: 'preconnect',
href: 'https://fonts.gstatic.com',
crossorigin: true,
},
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Roboto+Flex:wght@200..800&display=swap',
},
],
},
},
}) |
I'm using a composable. //composabels/useGoogleFonts.ts
import { useHead } from '@vueuse/head'
export function useGoogleFonts() {
useHead({
link: [
{
rel: 'preconnect',
href: 'https://fonts.googleapis.com'
},
{
rel: 'preconnect',
href: 'https://fonts.gstatic.com',
crossorigin: 'crossorigin'
},
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap'
}
],
})
} And call it in my app.vue <script lang="ts" setup>
import { useGoogleFonts } from './composables/useGoogleFonts'
useGoogleFonts()
</script> |
Hello guys! I tried to add the plugin into a NUXT3 app using vite, but it seems not to be working. Am I doing something wrong? I'm using the latest version (RC4) from Nuxt3.
My
nuxt.config.ts
is like this:The text was updated successfully, but these errors were encountered: