Using nuxt-icon in a custom module
avxkim opened this issue · 7 comments
avxkim commented
module.ts
installModule('nuxt-icon', {
size: '24px',
})
But inlineOptions
doesn't work, when i'm enabling this module inside a custom module.
avxkim commented
i did this way:
module.ts
nuxt.options.runtimeConfig.public.iconSize =
options.iconSize
then in a component
const config = useRuntimeConfig()
const iconSize = computed(
() => props.size || config.public.iconSize
)
is that ok?
atinux commented
Oh my bad I just saw that we are using the app.config.ts
for the configuration.
Could you try with nuxt.options.appConfig.icon.size = '24px'
?
avxkim commented
Cannot start nuxt: Cannot set properties of undefined (setting 'size')
avxkim commented
@Atinux is doing this
nuxt.options.runtimeConfig.public.iconSize =
options.iconSize
considerd as a bad practice?
atinux commented
You can do this yes