dataease-dm/frontend/src/components/canvas/custom-component/component-list.js

127 lines
2.4 KiB
JavaScript
Raw Normal View History

2021-03-25 19:16:32 +08:00
// 公共样式
export const commonStyle = {
rotate: 0,
opacity: 1
}
export const commonAttr = {
animations: [],
events: {},
groupStyle: {}, // 当一个组件成为 Group 的子组件时使用
isLock: false // 是否锁定组件
}
// 编辑器左侧组件列表
const list = [
{
2021-03-26 11:37:32 +08:00
id: '10001',
2021-03-25 19:16:32 +08:00
component: 'v-text',
label: '文字',
propValue: '双击编辑文字',
icon: 'wenben',
2021-03-26 11:37:32 +08:00
type: 'other',
2021-03-25 19:16:32 +08:00
style: {
width: 200,
height: 22,
fontSize: 14,
fontWeight: 500,
lineHeight: '',
letterSpacing: 0,
textAlign: '',
color: ''
}
},
{
2021-03-26 11:37:32 +08:00
id: '10002',
2021-03-25 19:16:32 +08:00
component: 'v-button',
label: '按钮',
propValue: '按钮',
icon: 'button',
2021-03-26 11:37:32 +08:00
type: 'other',
2021-03-25 19:16:32 +08:00
style: {
width: 100,
height: 34,
borderWidth: '',
borderColor: '',
borderRadius: '',
fontSize: 14,
fontWeight: 500,
lineHeight: '',
letterSpacing: 0,
textAlign: '',
color: '',
backgroundColor: ''
}
},
{
2021-03-26 11:37:32 +08:00
id: '10003',
2021-03-25 19:16:32 +08:00
component: 'Picture',
label: '图片',
icon: 'tupian',
2021-03-26 11:37:32 +08:00
type: 'other',
2021-03-30 15:38:32 +08:00
propValue: require('@/components/canvas/assets/title.jpg'),
2021-03-25 19:16:32 +08:00
style: {
width: 300,
height: 200,
borderRadius: ''
}
},
{
2021-03-26 11:37:32 +08:00
id: '10003-1',
component: 'Picture',
label: '背景-科技1',
icon: 'tupian',
type: 'other',
2021-03-30 15:38:32 +08:00
propValue: require('@/components/canvas/assets/bg-kj-1.jpg'),
2021-03-26 11:37:32 +08:00
style: {
width: 600,
height: 300,
borderRadius: ''
}
},
{
id: '10004',
2021-03-25 19:16:32 +08:00
component: 'rect-shape',
label: '矩形',
propValue: ' ',
icon: 'juxing',
2021-03-26 11:37:32 +08:00
type: 'other',
2021-03-25 19:16:32 +08:00
style: {
width: 200,
height: 200,
fontSize: 14,
fontWeight: 500,
lineHeight: '',
letterSpacing: 0,
textAlign: 'center',
color: '',
borderColor: '#000',
borderWidth: 1,
backgroundColor: '',
borderStyle: 'solid',
verticalAlign: 'middle'
}
},
{
2021-03-26 11:37:32 +08:00
id: '10005',
2021-03-25 19:16:32 +08:00
component: 'user-view',
label: '用户视图',
propValue: '',
icon: 'juxing',
type: 'view',
style: {
width: 200,
height: 300,
borderWidth: 1
}
}
]
for (let i = 0, len = list.length; i < len; i++) {
const item = list[i]
item.style = { ...commonStyle, ...item.style }
list[i] = { ...commonAttr, ...item }
}
export default list