Wirkhof
Wirkhof
Explore posts from servers
NNuxt
Created by Wirkhof on 11/15/2024 in #❓・help
Unable to restrict /es/admin path
I am using i18n Nuxt extension. This is my code:
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
modules: ['@nuxtjs/i18n'],
i18n: {
vueI18n: './i18n.config.ts',
locales: ['en', 'es'], // used in URL path prefix
defaultLocale: 'en',
customRoutes: 'config', // disable custom route with page components
pages: {
about: {
en: '/about-us', // -> accessible at /about-us (no prefix since it's the default locale)
es: '/sobre', // -> accessible at /es/sobre
},
'admin/index': false,
'admin/*': false, <----- doesn't work
},
},
});
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
modules: ['@nuxtjs/i18n'],
i18n: {
vueI18n: './i18n.config.ts',
locales: ['en', 'es'], // used in URL path prefix
defaultLocale: 'en',
customRoutes: 'config', // disable custom route with page components
pages: {
about: {
en: '/about-us', // -> accessible at /about-us (no prefix since it's the default locale)
es: '/sobre', // -> accessible at /es/sobre
},
'admin/index': false,
'admin/*': false, <----- doesn't work
},
},
});
I can visit /admin and cannot visit /es/admin . That's great and as expected. But I can visti both /admin/settings and /es/admin/settings. Which is not good. How to use stars or regex or something to block every other subpath for /es locale/prefix?
6 replies
NNuxt
Created by Wirkhof on 11/10/2024 in #❓・help
How to remove the "shaking" of vue icon in the status bar in VS Code?
I flickers every time I change to a different vue file of press save. How to get ridd of the shaking animation?
5 replies