App.ts 402 B

123456789101112131415161718192021
  1. import { defineComponent, h } from 'vue'
  2. import Carousel from '@/components/Carousel'
  3. import Slide from '@/components/Slide'
  4. export default defineComponent({
  5. name: 'App',
  6. setup() {
  7. const slides = [1, 2, 3, 4, 5]
  8. return () =>
  9. h(
  10. Carousel,
  11. {},
  12. {
  13. slides() {
  14. return slides.map((item) => h(Slide, {}))
  15. },
  16. }
  17. )
  18. },
  19. })