Skip to content

Commit 821c804

Browse files
committed
fix: stylelint
1 parent 249e0d2 commit 821c804

File tree

14 files changed

+133
-84
lines changed

14 files changed

+133
-84
lines changed

src/components/DiyEditor/components/ComponentContainer.vue

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -126,93 +126,106 @@ $active-border-width: 2px;
126126
$hover-border-width: 1px;
127127
$name-position: -85px;
128128
$toolbar-position: -55px;
129+
129130
/* 组件 */
130131
.component {
131132
position: relative;
132133
cursor: move;
134+
133135
.component-wrap {
134-
display: block;
135136
position: absolute;
136-
left: -$active-border-width;
137137
top: 0;
138+
left: -$active-border-width;
139+
display: block;
138140
width: 100%;
139141
height: 100%;
142+
140143
/* 鼠标放到组件上时 */
141144
&:hover {
142145
border: $hover-border-width dashed var(--el-color-primary);
143-
box-shadow: 0 0 5px 0 rgba(24, 144, 255, 0.3);
146+
box-shadow: 0 0 5px 0 rgb(24 144 255 / 30%);
147+
144148
.component-name {
149+
top: $hover-border-width;
150+
145151
/* 防止加了边框之后,位置移动 */
146152
left: $name-position - $hover-border-width;
147-
top: $hover-border-width;
148153
}
149154
}
155+
150156
/* 左侧:组件名称 */
151157
.component-name {
152-
display: block;
153158
position: absolute;
159+
top: $active-border-width;
160+
left: $name-position;
161+
display: block;
154162
width: 80px;
155-
text-align: center;
156-
line-height: 25px;
157163
height: 25px;
158-
background: #fff;
159164
font-size: 12px;
160-
left: $name-position;
161-
top: $active-border-width;
165+
line-height: 25px;
166+
text-align: center;
167+
background: #fff;
162168
box-shadow:
163169
0 0 4px #00000014,
164170
0 2px 6px #0000000f,
165171
0 4px 8px 2px #0000000a;
172+
166173
/* 右侧小三角 */
167-
&:after {
174+
&::after {
168175
position: absolute;
169176
top: 7.5px;
170177
right: -10px;
171-
content: ' ';
172-
height: 0;
173178
width: 0;
179+
height: 0;
174180
border: 5px solid transparent;
175181
border-left-color: #fff;
182+
content: ' ';
176183
}
177184
}
185+
178186
/* 右侧:组件操作工具栏 */
179187
.component-toolbar {
180-
display: none;
181188
position: absolute;
182189
top: 0;
183190
right: $toolbar-position;
191+
display: none;
192+
184193
/* 左侧小三角 */
185-
&:before {
194+
&::before {
186195
position: absolute;
187196
top: 10px;
188197
left: -10px;
189-
content: ' ';
190-
height: 0;
191198
width: 0;
199+
height: 0;
192200
border: 5px solid transparent;
193201
border-right-color: #2d8cf0;
202+
content: ' ';
194203
}
195204
}
196205
}
206+
197207
/* 组件选中时 */
198208
&.active {
199209
margin-bottom: 4px;
200210
201211
.component-wrap {
202-
border: $active-border-width solid var(--el-color-primary) !important;
203-
box-shadow: 0 0 10px 0 rgba(24, 144, 255, 0.3);
204212
margin-bottom: $active-border-width + $active-border-width;
213+
border: $active-border-width solid var(--el-color-primary) !important;
214+
box-shadow: 0 0 10px 0 rgb(24 144 255 / 30%);
205215
206216
.component-name {
207-
background: var(--el-color-primary);
208-
color: #fff;
217+
top: 0 !important;
218+
209219
/* 防止加了边框之后,位置移动 */
210220
left: $name-position - $active-border-width !important;
211-
top: 0 !important;
212-
&:after {
221+
color: #fff;
222+
background: var(--el-color-primary);
223+
224+
&::after {
213225
border-left-color: var(--el-color-primary);
214226
}
215227
}
228+
216229
.component-toolbar {
217230
display: block;
218231
}

src/components/DiyEditor/components/ComponentContainerProperty.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ const handleSliderChange = (prop: string) => {
157157
:deep(.el-slider__runway) {
158158
margin-right: 16px;
159159
}
160+
160161
:deep(.el-input-number) {
161162
width: 50px;
162163
}

src/components/DiyEditor/components/ComponentLibrary.vue

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,26 @@ const handleCloneComponent = (component: DiyComponent<any>) => {
9090
.editor-left {
9191
z-index: 1;
9292
flex-shrink: 0;
93-
box-shadow: 8px 0 8px -8px rgba(0, 0, 0, 0.12);
93+
box-shadow: 8px 0 8px -8px rgb(0 0 0 / 12%);
9494
9595
:deep(.el-collapse) {
9696
border-top: none;
9797
}
98+
9899
:deep(.el-collapse-item__wrap) {
99100
border-bottom: none;
100101
}
102+
101103
:deep(.el-collapse-item__content) {
102104
padding-bottom: 0;
103105
}
106+
104107
:deep(.el-collapse-item__header) {
105-
border-bottom: none;
106-
background-color: var(--el-bg-color-page);
107-
padding: 0 24px;
108108
height: 32px;
109+
padding: 0 24px;
109110
line-height: 32px;
111+
background-color: var(--el-bg-color-page);
112+
border-bottom: none;
110113
}
111114
112115
.component-container {
@@ -116,25 +119,26 @@ const handleCloneComponent = (component: DiyComponent<any>) => {
116119
}
117120
118121
.component {
122+
display: flex;
119123
width: 86px;
120124
height: 86px;
121-
display: flex;
125+
cursor: move;
126+
border-right: 1px solid var(--el-border-color-lighter);
127+
border-bottom: 1px solid var(--el-border-color-lighter);
122128
flex-direction: column;
123129
align-items: center;
124130
justify-content: center;
125-
border-right: 1px solid var(--el-border-color-lighter);
126-
border-bottom: 1px solid var(--el-border-color-lighter);
127-
cursor: move;
128131
129132
.el-icon {
130133
margin-bottom: 4px;
131134
color: gray;
132135
}
133136
}
137+
134138
.component.active,
135139
.component:hover {
136-
background: var(--el-color-primary);
137140
color: var(--el-color-white);
141+
background: var(--el-color-primary);
138142
139143
.el-icon {
140144
color: var(--el-color-white);
@@ -155,11 +159,10 @@ const handleCloneComponent = (component: DiyComponent<any>) => {
155159
.drag-area {
156160
/* 拖拽到手机区域时的样式 */
157161
.draggable-ghost {
162+
display: flex;
158163
width: 100%;
159164
height: 40px;
160-
display: flex;
161-
justify-content: center;
162-
align-items: center;
165+
163166
/* 条纹背景 */
164167
background: linear-gradient(
165168
45deg,
@@ -174,20 +177,25 @@ const handleCloneComponent = (component: DiyComponent<any>) => {
174177
);
175178
background-size: 1rem 1rem;
176179
transition: all 0.5s;
180+
justify-content: center;
181+
align-items: center;
182+
177183
span {
178-
color: #fff;
179184
display: inline-block;
180185
width: 140px;
181186
height: 25px;
182187
font-size: 12px;
183-
text-align: center;
184188
line-height: 25px;
189+
color: #fff;
190+
text-align: center;
185191
background: #5487df;
186192
}
193+
187194
/* 拖拽时隐藏组件 */
188195
.component {
189196
display: none;
190197
}
198+
191199
/* 拖拽时显示占位提示 */
192200
.drag-placement {
193201
display: block;

src/components/DiyEditor/components/mobile/ImageBar/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ defineProps<{ property: ImageBarProperty }>()
1717
<style scoped lang="scss">
1818
/* 图片 */
1919
img {
20+
display: block;
2021
width: 100%;
2122
height: 100%;
22-
display: block;
2323
}
2424
</style>

src/components/DiyEditor/components/mobile/NavigationBar/index.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,25 @@ defineProps<{ property: NavigationBarProperty }>()
3535
</script>
3636
<style lang="scss" scoped>
3737
.navigation-bar {
38+
display: flex;
3839
height: 35px;
3940
background: #fff;
40-
display: flex;
4141
justify-content: space-between;
4242
align-items: center;
43+
4344
/* 左边 */
4445
.left {
4546
margin-left: 8px;
4647
}
48+
4749
.center {
48-
flex: 1;
49-
text-align: center;
5050
font-size: 14px;
5151
line-height: 35px;
52-
color: #333333;
52+
color: #333;
53+
text-align: center;
54+
flex: 1;
5355
}
56+
5457
/* 右边 */
5558
.right {
5659
margin-right: 8px;

src/components/DiyEditor/components/mobile/SearchBar/index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ defineProps<{ property: SearchProperty }>()
4545
/* 搜索框 */
4646
.inner {
4747
position: relative;
48-
min-height: 28px;
4948
display: flex;
50-
align-items: center;
49+
min-height: 28px;
5150
font-size: 14px;
51+
align-items: center;
5252
5353
.placeholder {
5454
display: flex;
55-
align-items: center;
5655
width: 100%;
5756
padding: 0 8px;
58-
gap: 2px;
59-
text-overflow: ellipsis;
6057
overflow: hidden;
58+
text-overflow: ellipsis;
6159
word-break: break-all;
6260
white-space: nowrap;
61+
align-items: center;
62+
gap: 2px;
6363
}
6464
6565
.right {

src/components/DiyEditor/components/mobile/TabBar/index.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ defineProps<{ property: TabBarProperty }>()
3030
</script>
3131
<style lang="scss" scoped>
3232
.tab-bar {
33-
width: 100%;
3433
z-index: 2;
34+
width: 100%;
35+
3536
.tab-bar-bg {
3637
display: flex;
3738
flex-direction: row;
@@ -41,11 +42,11 @@ defineProps<{ property: TabBarProperty }>()
4142
4243
.tab-bar-item {
4344
display: flex;
45+
width: 100%;
46+
font-size: 12px;
4447
flex-direction: column;
4548
align-items: center;
4649
justify-content: center;
47-
font-size: 12px;
48-
width: 100%;
4950
5051
img {
5152
width: 26px;

src/components/DiyEditor/components/mobile/TitleBar/index.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,23 @@ defineProps<{ property: TitleBarProperty }>()
5656
</script>
5757
<style scoped lang="scss">
5858
.title-bar {
59-
border: 2px solid #fff;
60-
box-sizing: border-box;
59+
position: relative;
6160
width: 100%;
62-
padding: 8px 16px;
6361
min-height: 20px;
64-
position: relative;
62+
padding: 8px 16px;
63+
border: 2px solid #fff;
64+
box-sizing: border-box;
6565
6666
/* 更多 */
6767
.more {
6868
position: absolute;
69-
right: 8px;
7069
top: 0;
70+
right: 8px;
7171
bottom: 0;
72+
display: flex;
7273
margin: auto;
7374
font-size: 10px;
7475
color: #969799;
75-
display: flex;
7676
align-items: center;
7777
justify-content: center;
7878
}

src/components/DiyEditor/components/mobile/VideoPlayer/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ defineProps<{ property: VideoPlayerProperty }>()
2323
<style scoped lang="scss">
2424
/* 图片 */
2525
img {
26+
display: block;
2627
width: 100%;
2728
height: 100%;
28-
display: block;
2929
}
3030
</style>

0 commit comments

Comments
 (0)