/* * @Author: 卜启缘 * @Date: 2021-06-14 12:24:12 * @LastEditTime: 2021-07-11 16:43:31 * @LastEditors: 卜启缘 * @Description: 轮播图组件 * @FilePath: \vite-vue3-lowcode\src\packages\base-widgets\swipe\index.tsx */ import { Swipe, SwipeItem } from 'vant' import type { VisualEditorComponent } from '@/visual-editor/visual-editor.utils' import { createFieldProps } from './createFieldProps' import { useGlobalProperties } from '@/hooks/useGlobalProperties' const swipeItemStyle = `color: #fff; font-size: 20px; line-height: 150px; text-align: center; background-color: #39a9ed;` export default { key: 'swipe', moduleName: 'baseWidgets', label: '轮播图', preview: () => ( 1 2 3 4 ), render: ({ block, props }) => { const { registerRef } = useGlobalProperties() return (
registerRef(el, block._vid)} {...props} style={{ height: `${props.height}px` }} > {props.images?.map((item) => ( <> ))}
) }, props: createFieldProps(), events: [{ label: '每一页轮播结束后触发', value: 'change' }], showStyleConfig: false, resize: { width: true }, model: { default: '绑定字段' } } as VisualEditorComponent