Dynamic imports enable the loading of multiple items as needed, streamlining the import process.
With @openvue/icons for icons and openvue for components (except Editor and Chart), multiple items can be imported together.
import { Button, InputText } from 'openvue';
import { SearchIcon, BellIcon } from '@openvue/icons';
On the other hand, they enable the loading of multiple items from a specific structure as needed, making code management easier.
<script setup>
import * as OpenVue from 'openvue';
const items = [
{ as: 'Button', class: 'my-button-class' },
{ as: 'InputText', class: 'my-inputtext-class' }
};
</script>
<template>
<component v-for="item of items" :is="OpenVue[item.as]" :class="item.class" />
</template>