Question about Vuetify's custom icon alias implementation #20638
-
Hi there, The project I've been using Vuetify on (loving the library so far 😄) has been taking advantage of Vuetify's support for custom icon aliases for a while with MDI as shown in the docs. While providing icons this way and using them throughout our application with the So... with that in mind, I thought about providing our icon aliases in a TS object to improve on some of those negatives. That object looks like the following: import {
mdiAccountCircle,
mdiAccountGroup,
mdiAlert,
...
} from '@mdi/js';
const Icons = {
accountCircle: mdiAccountCircle,
accountGroup: mdiAccountGroup,
alert: mdiAlert,
...
};
export default Icons; And then use that object in our components like this: <template>
<v-icon :icon="Icons.icon" />
</template> The TS All that to say, does Vuetify provide icon aliases with treeshaking or any other performance improvements? Obviously needing to compute all of our icons when doing I'd appreciate any insight into this, even though I know it's a weird and kinda pedantic topic. Thanks!!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I decided that this was an unnecessary duplication of functionality that Vuetify already handles. No reason to have an object for this, since icons aren't likely to change. If any discussion is still warranted on this, feel free to comment on it. Closing this discussion. |
Beta Was this translation helpful? Give feedback.
I decided that this was an unnecessary duplication of functionality that Vuetify already handles. No reason to have an object for this, since icons aren't likely to change.
If any discussion is still warranted on this, feel free to comment on it. Closing this discussion.