I've developed a vue application using the vue-cli
As I create components, I want to utilize them in this manner:
<template>
<oi-list>
<oi-list-header>Task ID</oi-list-header>
<oi-list-header>Tasks Title</oi-list-header>
<oi-list-header>Task Status</oi-list-header>
<div v-for="task in tasks">
<oi-list-item>{{ task.id }}</oi-list-item>
<oi-list-item>{{ task.title }}</oi-list-item>
<oi-list-item>{{ task.status }}</oi-list-item>
</div>
</oi-list>
</tempalte>
The issue I'm facing is that every time I use the list component, I need to include the following code:
<script>
import List from '@/components/List'
import ListHeader from '@/components/ListHeader'
import ListItem from '@/components/ListItem'
export default {
name: "Tasks",
components: {
'oi-list': List,
'oi-list-header': ListHeader,
'oi-list-item': ListItem
}
<script>
I would prefer to have reusable components either globally registered so that I don't have to import them and their sub-components each time, or dynamically loaded when used. Is there a way to achieve this?
In the past, I have worked with Vuetify, where individual component imports are not required for usage.
If anyone could provide guidance on this, I would greatly appreciate it. Thanks.