Implement import of all SVG icons as assets in new frontend, second step

This commit is contained in:
Wolfgang Huß 2024-03-20 20:12:53 +01:00
parent bc3f18ae87
commit f40ec2fe5f

View File

@ -8,16 +8,16 @@ import { aliases } from 'vuetify/iconsets/mdi-svg'
import { createVueI18nAdapter } from 'vuetify/locale/adapters/vue-i18n'
import CustomIcons from '#assets/icons'
import CustomIcon from '#assets/icons/svgComponents/glass.vue'
// import CustomIcon from '#assets/icons/svgComponents/glass.vue'
console.log('aliases: ', aliases)
console.log('CustomIcons.glass: ', CustomIcons.glass.default)
console.log('CustomIcon: ', CustomIcon)
// console.log('aliases: ', aliases)
// console.log('CustomIcons.glass: ', CustomIcons.glass.default)
// console.log('CustomIcon: ', CustomIcon)
const aliasesCustom: IconAliases = {
...aliases,
// glass: CustomIcon,
glass: CustomIcons.glass.default as never,
// glass: CustomIcons.glass.default as never,
// ...CustomIcons,
}
@ -30,10 +30,12 @@ const aliasesCustom: IconAliases = {
// // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
// aliasesCustom[component.iconName] = component.mod
// }
// Object.entries(CustomIcons).forEach(([key, module]) => {
// // aliasesCustom[key] = module as IconValue
// aliasesCustom = { ...aliasesCustom, [key]: module }
// })
Object.entries(CustomIcons).forEach(([key, value]) => {
// aliasesCustom[key] = module as never
Object.assign(aliasesCustom, { [key]: value.default as never })
})
console.log('aliasesCustom: ', aliasesCustom)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export default (i18n: I18n<any, NonNullable<unknown>, NonNullable<unknown>, string, false>) =>