import snippets from './snippets'; export default { snippets, componentName: 'AMImage', docUrl: 'https://mobile.ant.design/zh/components/image', title: '图片', category: '数据展示', group: '基础组件', props: [ { name: 'src', title: { label: '图片地址', tip: '图片地址' }, propType: { type: 'string', isRequired: true }, }, { name: 'alt', title: { label: '替换文本', tip: '替换文本' }, propType: 'string', }, { name: 'fallback', title: { label: '失败地址', tip: '加载失败容错地址' }, propType: 'string', }, { name: 'width', title: { label: '宽度', tip: '宽度' }, propType: 'number', }, { name: 'height', title: { label: '高度', tip: '高度' }, propType: 'number', }, { name: 'fit', title: { label: '填充模式', tip: 'fit | 填充模式' }, propType: { type: 'oneOf', value: ['contain', 'cover', 'fill', 'none', 'scale-down'], }, setter: [ { componentName: 'SelectSetter', props: { options: [ { title: 'contain', value: 'contain', }, { title: 'cover', value: 'cover', }, { title: 'fill', value: 'fill', }, { title: 'none', value: 'none', }, { title: 'scale-down', value: 'scale-down', }, ], }, }, 'VariableSetter', ], defaultValue: 'fill', }, { name: 'lazy', title: { label: '懒加载', tip: 'lazy 是否懒加载' }, propType: 'bool', setter: 'BoolSetter', supportVariable: true, }, ], configure: { supports: { style: true, events: [ { name: 'onClick', description: '点击按钮时的回调', template: "onClick(event,extParams){\n// 点击按钮时的回调\nconsole.log('onClick', event);}", }, ], }, }, };