config.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import { DiyComponent } from '@/components/DiyEditor/util'
  2. /** 轮播图属性 */
  3. export interface CarouselProperty {
  4. // 选择模板
  5. swiperType: number
  6. // 图片圆角
  7. borderRadius: number
  8. // 页面边距
  9. pageMargin: number
  10. // 图片边距
  11. imageMargin: number
  12. // 分页类型
  13. pagingType: 'bullets' | 'fraction' | 'progressbar'
  14. // 一行个数
  15. rowIndividual: number
  16. // 添加图片
  17. items: CarouselItemProperty[]
  18. }
  19. export interface CarouselItemProperty {
  20. title: string
  21. imgUrl: string
  22. link: string
  23. }
  24. // 定义组件
  25. export const component = {
  26. id: 'Carousel',
  27. name: '轮播图',
  28. icon: 'system-uicons:carousel',
  29. property: {
  30. swiperType: 0, // 选择模板
  31. borderRadius: 0, // 图片圆角
  32. pageMargin: 0, // 页面边距
  33. imageMargin: 0, // 图片边距
  34. pagingType: 'bullets', // 分页类型
  35. rowIndividual: 2, // 一行个数
  36. items: [
  37. { imgUrl: 'https://static.iocoder.cn/mall/banner-01.jpg' },
  38. { imgUrl: 'https://static.iocoder.cn/mall/banner-02.jpg' }
  39. ] as CarouselItemProperty[]
  40. }
  41. } as DiyComponent<CarouselProperty>