|
| 1 | +import { Progress } from 'vant' |
| 2 | +import { |
| 3 | + createEditorColorProp, |
| 4 | + createEditorSwitchProp, |
| 5 | + createEditorInputProp, |
| 6 | + createEditorInputNumberProp |
| 7 | +} from '@/visual-editor/visual-editor.props' |
| 8 | +import { VisualEditorComponent } from '@/visual-editor/visual-editor.utils' |
| 9 | + |
| 10 | +export default { |
| 11 | + key: 'divider', |
| 12 | + moduleName: 'baseWidgets', |
| 13 | + label: '进度条', |
| 14 | + preview: () => <Progress style="width:190px" percentage={0} />, |
| 15 | + render: ({ props }) => { |
| 16 | + return <Progress {...props} pivotText={props.pivotText || undefined} /> |
| 17 | + }, |
| 18 | + props: { |
| 19 | + percentage: createEditorInputNumberProp({ label: '进度百分比', defaultValue: 50 }), |
| 20 | + strokeWidth: createEditorInputNumberProp({ label: '线条粗细', defaultValue: 5 }), |
| 21 | + inactive: createEditorSwitchProp({ label: '是否置灰', defaultValue: false }), |
| 22 | + color: createEditorColorProp('进度条颜色', '#1989fa'), |
| 23 | + trackColor: createEditorColorProp('轨道颜色', '#e5e5e5'), |
| 24 | + pivotText: createEditorInputProp({ label: '进度文字内容' }), |
| 25 | + pivotColor: createEditorColorProp('进度文字背景色', '#1989fa'), |
| 26 | + textColor: createEditorColorProp('进度文字颜色', '#ffffff'), |
| 27 | + showPivot: createEditorSwitchProp({ label: '是否显示进度文字', defaultValue: true }) |
| 28 | + } |
| 29 | +} as VisualEditorComponent |
0 commit comments