load-plugins.js
6.32 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
import Vue from 'vue'
// import LbpButton from '@luban-h5/lbc-button'
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 LbpFormCheckboxGroup from '../components/plugins/lbp-form-checkbox-group'
import LbpBackground from '../components/plugins/lbp-background'
import LbpSlide from '../components/plugins/lbp-slide'
import LbpBgMusic from '../components/plugins/lbp-bg-music'
import LbpNoticeBar from '../components/plugins/lbp-notice-bar'
import LbpRate from '../components/plugins/lbp-rate'
import LbpQQMap from '../components/plugins/lbp-qq-map/src'
import LbpLineChart from '../components/plugins/charts/line'
import LbpTable from '../components/plugins/lbp-table'
// import LbpTabs from '../components/plugins/lbp-tabs'
export const pluginsList = [
{
i18nTitle: {
'en-US': 'LineChart',
'zh-CN': '折线图'
},
title: '折线图',
icon: 'line-chart',
component: LbpLineChart,
visible: true,
name: LbpLineChart.name,
shortcutProps: {
type: 'line'
}
},
{
i18nTitle: {
'en-US': 'LineChart',
'zh-CN': '柱状图'
},
title: '柱状图',
icon: 'bar-chart',
component: LbpLineChart,
visible: true,
name: LbpLineChart.name,
shortcutProps: {
type: 'histogram'
}
},
{
i18nTitle: {
'en-US': 'LineChart',
'zh-CN': '饼状图'
},
title: '饼状图',
icon: 'pie-chart',
component: LbpLineChart,
visible: true,
name: LbpLineChart.name,
shortcutProps: {
type: 'pie'
}
},
{
i18nTitle: {
'en-US': 'LineChart',
'zh-CN': '漏斗图'
},
title: '漏斗图',
icon: 'filter',
component: LbpLineChart,
visible: true,
name: LbpLineChart.name,
shortcutProps: {
type: 'funnel'
}
},
{
title: '公告',
i18nTitle: {
'en-US': 'Notice-Bar',
'zh-CN': '公告'
},
icon: 'volume-up',
component: LbpNoticeBar,
visible: true,
name: LbpNoticeBar.name
},
// {
// title: '标签页',
// i18nTitle: {
// 'en-US': 'Tabs',
// 'zh-CN': '标签页'
// },
// icon: 'tab',
// component: LbpTabs,
// visible: true,
// name: LbpTabs.name
// },
{
title: '评分',
i18nTitle: {
'en-US': 'Rate',
'zh-CN': '评分'
},
icon: 'star-o',
component: LbpRate,
visible: true,
name: LbpRate.name
},
{
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: LbpQQMap,
visible: true,
name: LbpQQMap.name
// disabled: true
},
{
i18nTitle: {
'en-US': 'Video',
'zh-CN': '视频'
},
title: '视频',
icon: 'file-video-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
},
{
i18nTitle: {
'en-US': 'Form Checkbox',
'zh-CN': '表单多选'
},
title: '表单多选',
icon: 'check-square-o',
component: LbpFormCheckboxGroup,
visible: true,
name: LbpFormCheckboxGroup.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
},
{
i18nTitle: {
'en-US': 'BgMusic',
'zh-CN': '背景音乐'
},
title: '背景音乐',
icon: 'music',
component: LbpBgMusic,
visible: true,
name: LbpBgMusic.name
},
{
i18nTitle: {
'en-US': 'Table(Default)',
'zh-CN': '默认表格'
},
icon: 'table',
component: LbpTable,
visible: true,
name: LbpTable.name,
},
{
i18nTitle: {
'en-US': 'Table(Stripe)',
'zh-CN': '(斑马线)表格'
},
icon: 'table',
component: LbpTable,
visible: true,
name: LbpTable.name,
shortcutProps: {
theme: 'lbp-table-theme-stripe'
}
},
{
i18nTitle: {
'en-US': 'Table(LightBlue)',
'zh-CN': '(淡蓝色)表格'
},
icon: 'table',
component: LbpTable,
visible: true,
name: LbpTable.name,
shortcutProps: {
theme: 'lbp-table-theme-light-blue'
}
},
]
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()
}
}