响应此问题的回答如下:
有人能提供一个玩具示例或解释如何做到这一点吗?为了澄清,我想要导入组件(例如A.vue、B.vue、C.vue)到另一个组件(例如Carousel.vue),然后在轮播中显示这些组件。类似于以下内容:文档中缺少插槽,您已经可以这样做了。
<template>
<v-carousel>
<v-carousel-item v-for="(component, i) in components"></v-carousel-item>
</v-carousel>
</template>
<script>
import A from '@/components/A'
import B from '@/components/B'
import C from '@/components/C'
export default {
components: {
A,
B,
C
}
</script>
v-carousel
中,例如<v-carousel> <your-custom-component/> </v-carousel>
。或者也可以放在项目中:<v-carousel-item> <v-btn>Hi</v-btn> </v-carousel-item>
。什么没有起作用? - Traxo<v-carousel-item>
标签里让它正常工作了。如果您想发布解决方案,我会接受的。否则我会把我写的东西发表为答案。谢谢。 - wayeast