- 组件引入时类似路由懒加载
this.$options.components
为当前 .vue 中的组件。 $options :所有配置项
<template>
<div class="medical_health_dialog">
<div
class="item"
v-for="(item, name, i) in $options.components"
:key="name"
>
<component :is="item" :chartData="chartData" v-if="chartData[i]" />
</div>
</div>
</template>
<script>
export default {
components: {
FamilyDoctor: () => import('./FamilyDoctor'),
DiseaseManagement: () => import('./DiseaseManagement'),
VillagersTreatment: () => import('./VillagersTreatment')
}
};
</script>
记得好像有 bug 是图表还是什么的,这个只是记录没有在正式上用,有知道的小伙伴可以留言给我