load-plugins.js
3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import Vue from 'vue'
import LbpButton from '../components/plugins/lbp-button'
import LbpPicture from '../components/plugins/lbp-picture'
import LbpVideo from '../components/plugins/lbp-video'
import LbpText from '../components/plugins/lbp-text'
import LbpFormInput from '../components/plugins/lbp-form-input'
import LbpFormButton from '../components/plugins/lbp-form-button'
import LbpFormRadioGroup from '../components/plugins/lbp-form-radio-group'
import LbpBackground from '../components/plugins/lbp-background'
import LbpSlide from '../components/plugins/lbp-slide'
export const pluginsList = [
{
title: '图片',
i18nTitle: {
'en-US': 'Picture',
'zh-CN': '图片'
},
icon: 'photo',
component: LbpPicture,
visible: true,
name: LbpPicture.name
},
{
i18nTitle: {
'en-US': 'Text',
'zh-CN': '文字'
},
title: '文字',
icon: 'text-width',
component: LbpText,
visible: true,
name: LbpText.name
},
{
i18nTitle: {
'en-US': 'Button',
'zh-CN': '普通按钮'
},
title: '普通按钮',
icon: 'hand-pointer-o',
component: LbpButton,
visible: true,
name: LbpButton.name
},
{
i18nTitle: {
'en-US': 'Carousel',
'zh-CN': '轮播图'
},
title: '轮播图',
icon: 'photo',
component: LbpSlide,
visible: true,
name: LbpSlide.name
// disabled: true
},
{
i18nTitle: {
'en-US': 'Map',
'zh-CN': '地图'
},
title: '地图',
icon: 'map-o',
component: LbpFormRadioGroup,
visible: true,
name: LbpFormRadioGroup.name,
disabled: true
},
{
i18nTitle: {
'en-US': 'Video',
'zh-CN': '视频'
},
title: '视频',
icon: 'file-video-o',
component: LbpVideo,
visible: true,
name: LbpVideo.name
},
// {
// title: '视频',
// icon: 'play-circle-o',
// component: LbpVideo,
// visible: true,
// name: LbpVideo.name
// },
{
i18nTitle: {
'en-US': 'Form Input',
'zh-CN': '表单输入'
},
title: '表单输入',
icon: 'pencil-square-o',
component: LbpFormInput,
visible: true,
name: LbpFormInput.name
},
{
i18nTitle: {
'en-US': 'Form Submit',
'zh-CN': '表单提交'
},
title: '表单提交',
icon: 'hand-pointer-o',
component: LbpFormButton,
visible: true,
name: LbpFormButton.name
},
// {
// title: '表单单选',
// icon: 'hand-pointer-o',
// component: LbpFormRadio,
// visible: true,
// name: LbpFormRadio.name
// },
{
i18nTitle: {
'en-US': 'Form Checkbox',
'zh-CN': '表单多选'
},
title: '表单单选',
icon: 'check-square-o',
component: LbpFormRadioGroup,
visible: true,
name: LbpFormRadioGroup.name
},
{
i18nTitle: {
'en-US': 'Form Radio',
'zh-CN': '表单单选'
},
title: '表单单选',
icon: 'dot-circle-o',
component: LbpFormRadioGroup,
visible: true,
name: LbpFormRadioGroup.name
},
{
i18nTitle: {
'en-US': 'Background',
'zh-CN': '背景'
},
title: '背景',
icon: 'dot-circle-o',
component: LbpBackground,
visible: false,
name: LbpBackground.name
}
]
export default {
data: () => ({
pluginsList
}),
methods: {
mixinPlugins2Editor () {
pluginsList.forEach(plugin => {
// 全局注册组件,便于以后扩展自定义脚本,注释原来的局部注册:this.$options.components[plugin.name] = plugin.component
Vue.component(plugin.name, plugin.component)
})
}
},
created () {
this.mixinPlugins2Editor()
}
}