Skip to content

Commit fc87d5d

Browse files
committed
chore: 更新活动编辑器页
chore: 更新活动编辑页Ui chore(demo): 更新活动编辑器页,添加移动页面 chore(demo): 优化活动编辑器代码,简化配置 chore(demo): 活动编辑器移动端添加一个分类板块 chore: 更新活动编辑器完成移动端页面
1 parent 91d15d8 commit fc87d5d

File tree

35 files changed

+1445
-97
lines changed

35 files changed

+1445
-97
lines changed

packages/demo/src/vue-editor/router/routes/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ const routes = [
77
},
88
component: () => import('../../views/editor/Editor.vue'),
99
},
10+
{
11+
path: '/editor-m',
12+
name: 'editorM',
13+
meta: {
14+
title: 'Vue Editor Mobile'
15+
},
16+
component: () => import('../../views/editor/EditorM.vue'),
17+
},
1018
{
1119
path: '*',
1220
hidden: true,
13-
redirect: { name: 'editor' }
21+
redirect: { name: 'editorM' }
1422
}
1523
];
1624

packages/demo/src/vue-editor/views/editor/Editor.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<EditorToolBar
3232
:current-use-component-num="currentUseComponentNum"
3333
:drag-group="dragOptions.group"
34+
:config-tools="configTools"
3435
@onFilter="$message.error('该组件添加数目已达上限!')"
3536
>
3637
</EditorToolBar>
@@ -52,8 +53,7 @@
5253
:class="{
5354
draggableSlot: item.$$slot,
5455
draggableItem: !item.$$slot,
55-
[`draggableSlot_${item.$$slot}`]: item.$$slot,
56-
[$style.viewComponentItem]: true
56+
[`draggableSlot_${item.$$slot}`]: item.$$slot
5757
}"
5858
>
5959
<ViewComponentWrap
@@ -124,15 +124,18 @@
124124
import configTools from './config/tools';
125125
import configDefaultItems from './config/defaultItems';
126126
127-
import { getComponentsConfig } from './common/utils';
127+
import { getComponentsAndInitToolsConfig } from './common/utils';
128128
129129
import { generateEditorItem } from './common/editorData';
130130
import './common/registerExtraElementComponent';
131131
132+
// 工具栏配置的组件
133+
const components = getComponentsAndInitToolsConfig(configTools);
134+
132135
export default {
133136
name: 'Editor',
134137
components: {
135-
...getComponentsConfig(configTools),
138+
...components,
136139
VueElementForm,
137140
Draggable,
138141
EditorToolBar,
@@ -143,6 +146,7 @@
143146
return {
144147
loading: false,
145148
isPreview: false,
149+
configTools,
146150
scale: 70,
147151
editComponentList: [],
148152
editHeaderComponentList: [], // 兼容header slot ,插件内部实现导致必须分割多分数据
@@ -441,8 +445,9 @@
441445
transform: translate(-50%, 0);
442446
cursor: auto;
443447
box-shadow: none;
444-
&:hover, &:active{
445-
box-shadow: none;
448+
&:after {
449+
display: none;
450+
content: none;
446451
}
447452
}
448453
}
@@ -582,11 +587,6 @@
582587
}
583588
}
584589
}
585-
.viewComponentItem {
586-
&+.viewComponentItem {
587-
margin-top: 10px;
588-
}
589-
}
590590
.ghost {
591591
opacity: 0.5;
592592
}

packages/demo/src/vue-editor/views/editor/EditorHeader.vue

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
<h1>Vue Editor</h1>
55
</div>
66
<div :class="$style.btns">
7+
<el-select v-model="platform" placeholder="请选择" :class="$style.selectPlatform">
8+
<el-option label="PC" value="editor"></el-option>
9+
<el-option label="M" value="editorM"></el-option>
10+
</el-select>
711
<el-button icon="el-icon-minus"
812
:disabled="disabledMinus"
913
:class="$style.scaleBtn"
@@ -45,6 +49,16 @@
4549
}
4650
},
4751
computed: {
52+
platform: {
53+
get() {
54+
return this.$route.name;
55+
},
56+
set(routerName) {
57+
this.$router.replace({
58+
name: routerName
59+
});
60+
}
61+
},
4862
disabledMinus() {
4963
return this.value <= this.minScale;
5064
},
@@ -79,6 +93,8 @@
7993
background: var(--color-white);
8094
display: flex;
8195
justify-content: space-between;
96+
align-items: center;
97+
box-shadow: 0 1px 1px 0 rgba(0,0,0,0.2);
8298
}
8399
.logo {
84100
display: flex;
@@ -90,9 +106,8 @@
90106
text-transform: uppercase;
91107
}
92108
}
93-
.scaleBtn {
94-
&.disabled {
95-
96-
}
109+
.selectPlatform {
110+
width: 100px;
111+
margin-right: 20px;
97112
}
98113
</style>

0 commit comments

Comments
 (0)