jovan
jovan
NNuxt
Created by jovan on 10/16/2024 in #❓・help
@nuxt/icon custom collection with ssr: false
I'm trying to create a custom collection of icons, but I'm having trouble because I have SSR set to false. My configuration for icons is simple: icon: { customCollections: [ { prefix: 'custom-icons', dir: '/public/assets/icons' } ] }, I tried using provider: 'server', but it's not working. I also tried mode: 'svg', and I can see that the icons are being fetched in the Network tab, but they are not displaying. Does anyone know the best approach here?
1 replies
NNuxt
Created by jovan on 10/8/2024 in #❓・help
@nuxtjs/i18n test errors
Hi everyone, I'm using the @nuxtjs/i18n library in my Nuxt project and am currently writing a test for a Vue component. However, I keep running into the following errors: "Need to install with app.use function" "$t is not a function" My component is fairly simple, rendering translations inside the <template> using $t. Here’s the basic test I'm working on: test('renders all child components', () => { const wrapper = mount(AppSettings, { global: { components: mockComponents, mocks: { $t: (key: string) => key, // Mocking the i18n $t function }, }, }); Object.keys(mockComponents).forEach((componentName) => { expect(wrapper.findComponent({ name: componentName }).exists()).toBe(true); }); }); I've tried mocking the $t function, but I still get the "Need to install with app.use function" error. Does anyone know why this is happening or how to resolve it? Thanks!
19 replies