officialblock 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-Ch_ldWmA.js +1 -0
- package/dist/index-DXm2cqxo.mjs +485 -0
- package/dist/official-block.cjs.js +74 -74
- package/dist/official-block.es.js +13577 -10832
- package/dist/official-block.umd.js +78 -78
- package/dist/style.css +1 -1
- package/dist/swiper-JiLDDxAF.js +1 -0
- package/dist/swiper-acbnDJoL.mjs +2035 -0
- package/dist/utils-DD-vVZej.mjs +316 -0
- package/dist/utils-DOLLD0-F.js +1 -0
- package/package.json +2 -1
- package/src/components/ArticleList/article.vue +3 -3
- package/src/components/ArticleList/contact.vue +9 -9
- package/src/components/ArticleList/index.ts +1 -1
- package/src/components/ArticleList/index.vue +24 -82
- package/src/components/ArticleList/setting.vue +61 -71
- package/src/components/ArticleList/type.ts +12 -18
- package/src/components/BannerImage/index.ts +11 -0
- package/src/components/BannerImage/index.vue +153 -0
- package/src/components/BannerImage/setting.vue +55 -0
- package/src/components/BannerImage/type.ts +10 -0
- package/src/components/BannerPage/index.ts +11 -0
- package/src/components/BannerPage/index.vue +283 -0
- package/src/components/BannerPage/setting.vue +55 -0
- package/src/components/BannerPage/type.ts +10 -0
- package/src/components/BtnList/index.ts +11 -0
- package/src/components/BtnList/index.vue +588 -0
- package/src/components/BtnList/setting.vue +255 -0
- package/src/components/BtnList/type.ts +10 -0
- package/src/components/Button/index.vue +45 -33
- package/src/components/CustomSpace/index.ts +11 -0
- package/src/components/CustomSpace/index.vue +82 -0
- package/src/components/CustomSpace/setting.vue +89 -0
- package/src/components/CustomSpace/type.ts +10 -0
- package/src/components/GalleryList/index.ts +12 -0
- package/src/components/GalleryList/index.vue +311 -0
- package/src/components/GalleryList/setting.vue +268 -0
- package/src/components/GalleryList/type.ts +10 -0
- package/src/components/HeroSlide/index.ts +1 -1
- package/src/components/HeroSlide/index.vue +85 -133
- package/src/components/HeroSlide/setting.vue +435 -0
- package/src/components/HeroSlide/type.ts +5 -14
- package/src/components/LinkLIst/index.ts +11 -0
- package/src/components/LinkLIst/index.vue +317 -0
- package/src/components/LinkLIst/setting.vue +264 -0
- package/src/components/LinkLIst/type.ts +10 -0
- package/src/components/Media/index.vue +18 -18
- package/src/components/Operate/index.vue +17 -7
- package/src/components/Profile/index.vue +999 -0
- package/src/components/Profile/modal.vue +56 -0
- package/src/components/Profile/setting.vue +330 -0
- package/src/components/QuickLinks/index.vue +166 -0
- package/src/components/QuoteText/index.ts +11 -0
- package/src/components/QuoteText/index.vue +133 -0
- package/src/components/QuoteText/setting.vue +81 -0
- package/src/components/QuoteText/type.ts +10 -0
- package/src/components/ScrollKeyInfo/index.vue +0 -0
- package/src/components/Swiper/index.vue +538 -0
- package/src/components/index.ts +23 -5
- package/src/index.ts +56 -12
- package/src/main.ts +6 -3
- package/src/router/index.ts +6 -0
- package/src/style.css +17 -0
- package/src/styles/component-isolation.scss +256 -0
- package/src/styles/editor.scss +1 -1
- package/src/styles/layers.scss +256 -0
- package/src/styles/main.scss +21687 -0
- package/src/styles/mixins/style-isolation.scss +262 -0
- package/src/styles/smart-reset.scss +287 -0
- package/src/styles/test.scss +1 -1
- package/src/types/button.ts +10 -0
- package/src/views/StyleIsolationTest.vue +292 -0
- package/src/views/components/ArticleListDemo.vue +49 -10
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="style-isolation-test">
|
|
3
|
+
<h1>样式隔离测试页面</h1>
|
|
4
|
+
|
|
5
|
+
<div class="test-section">
|
|
6
|
+
<h2>Operate 组件测试</h2>
|
|
7
|
+
<p>测试 Operate 组件的字体大小是否为 10px,不被全局样式污染:</p>
|
|
8
|
+
|
|
9
|
+
<div class="demo-container">
|
|
10
|
+
<Operate :show="true" />
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="comparison">
|
|
14
|
+
<h3>对比测试</h3>
|
|
15
|
+
<div class="comparison-item">
|
|
16
|
+
<span class="label">全局默认字体 (14px):</span>
|
|
17
|
+
<span class="global-text">这是全局默认字体大小</span>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="comparison-item">
|
|
20
|
+
<span class="label">10px 字体:</span>
|
|
21
|
+
<span class="fs-isolated-10">这是 10px 字体大小</span>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="comparison-item">
|
|
24
|
+
<span class="label">12px 字体:</span>
|
|
25
|
+
<span class="fs-isolated-12">这是 12px 字体大小</span>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="comparison-item">
|
|
28
|
+
<span class="label">16px 字体:</span>
|
|
29
|
+
<span class="fs-isolated-16">这是 16px 字体大小</span>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="test-section">
|
|
35
|
+
<h2>样式隔离工具类测试</h2>
|
|
36
|
+
<p>测试各种隔离工具类是否正常工作:</p>
|
|
37
|
+
|
|
38
|
+
<div class="utility-tests">
|
|
39
|
+
<div class="test-group">
|
|
40
|
+
<h4>字体大小测试</h4>
|
|
41
|
+
<div class="fs-isolated-8">8px 字体</div>
|
|
42
|
+
<div class="fs-isolated-10">10px 字体</div>
|
|
43
|
+
<div class="fs-isolated-12">12px 字体</div>
|
|
44
|
+
<div class="fs-isolated-14">14px 字体</div>
|
|
45
|
+
<div class="fs-isolated-16">16px 字体</div>
|
|
46
|
+
<div class="fs-isolated-20">20px 字体</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div class="test-group">
|
|
50
|
+
<h4>字体权重测试</h4>
|
|
51
|
+
<div class="fw-isolated-300">300 细体</div>
|
|
52
|
+
<div class="fw-isolated-400">400 正常</div>
|
|
53
|
+
<div class="fw-isolated-500">500 中等</div>
|
|
54
|
+
<div class="fw-isolated-600">600 半粗</div>
|
|
55
|
+
<div class="fw-isolated-700">700 粗体</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="test-group">
|
|
59
|
+
<h4>颜色测试</h4>
|
|
60
|
+
<div class="text-isolated-primary">主色文字</div>
|
|
61
|
+
<div class="text-isolated-success">成功色文字</div>
|
|
62
|
+
<div class="text-isolated-warning">警告色文字</div>
|
|
63
|
+
<div class="text-isolated-danger">危险色文字</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="test-group">
|
|
67
|
+
<h4>背景色测试</h4>
|
|
68
|
+
<div class="bg-isolated-primary text-isolated-white p-isolated-2">主色背景</div>
|
|
69
|
+
<div class="bg-isolated-success text-isolated-white p-isolated-2">成功色背景</div>
|
|
70
|
+
<div class="bg-isolated-warning text-isolated-white p-isolated-2">警告色背景</div>
|
|
71
|
+
<div class="bg-isolated-danger text-isolated-white p-isolated-2">危险色背景</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div class="test-group">
|
|
75
|
+
<h4>布局测试</h4>
|
|
76
|
+
<div class="d-isolated-flex justify-isolated-between align-isolated-center p-isolated-3 border-isolated-1">
|
|
77
|
+
<span>左侧内容</span>
|
|
78
|
+
<span>右侧内容</span>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div class="test-section">
|
|
85
|
+
<h2>组件隔离容器测试</h2>
|
|
86
|
+
<p>测试组件隔离容器是否能有效隔离全局样式:</p>
|
|
87
|
+
|
|
88
|
+
<div class="isolation-demo">
|
|
89
|
+
<div class="normal-container">
|
|
90
|
+
<h4>普通容器(受全局样式影响)</h4>
|
|
91
|
+
<div class="test-element">这个元素受全局样式影响</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div class="component-isolation">
|
|
95
|
+
<h4>隔离容器(不受全局样式影响)</h4>
|
|
96
|
+
<div class="test-element">这个元素在隔离容器中</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div class="test-results">
|
|
102
|
+
<h2>测试结果说明</h2>
|
|
103
|
+
<div class="result-item">
|
|
104
|
+
<strong>✅ 成功:</strong>Operate 组件的按钮文字显示为 10px,不受全局 14px 字体影响
|
|
105
|
+
</div>
|
|
106
|
+
<div class="result-item">
|
|
107
|
+
<strong>✅ 成功:</strong>隔离工具类正常工作,可以精确控制样式
|
|
108
|
+
</div>
|
|
109
|
+
<div class="result-item">
|
|
110
|
+
<strong>✅ 成功:</strong>组件隔离容器有效隔离了全局样式污染
|
|
111
|
+
</div>
|
|
112
|
+
<div class="result-item">
|
|
113
|
+
<strong>ℹ️ 说明:</strong>所有样式都使用 !important 确保优先级
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</template>
|
|
118
|
+
|
|
119
|
+
<script setup lang="ts">
|
|
120
|
+
import Operate from '@/components/Operate/index.vue'
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<style lang="scss" scoped>
|
|
124
|
+
.style-isolation-test {
|
|
125
|
+
max-width: 1200px;
|
|
126
|
+
margin: 0 auto;
|
|
127
|
+
padding: 20px;
|
|
128
|
+
|
|
129
|
+
h1 {
|
|
130
|
+
color: #1d2129;
|
|
131
|
+
margin-bottom: 2rem;
|
|
132
|
+
text-align: center;
|
|
133
|
+
font-size: 2rem;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.test-section {
|
|
137
|
+
margin-bottom: 3rem;
|
|
138
|
+
padding: 2rem;
|
|
139
|
+
border: 1px solid #e5e6eb;
|
|
140
|
+
border-radius: 8px;
|
|
141
|
+
background: #ffffff;
|
|
142
|
+
|
|
143
|
+
h2 {
|
|
144
|
+
color: #4e5969;
|
|
145
|
+
margin-bottom: 1rem;
|
|
146
|
+
padding-bottom: 0.5rem;
|
|
147
|
+
border-bottom: 2px solid #1890ff;
|
|
148
|
+
font-size: 1.5rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
h3 {
|
|
152
|
+
color: #1d2129;
|
|
153
|
+
margin: 1.5rem 0 1rem 0;
|
|
154
|
+
font-size: 1.2rem;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
h4 {
|
|
158
|
+
color: #4e5969;
|
|
159
|
+
margin: 1rem 0 0.5rem 0;
|
|
160
|
+
font-size: 1rem;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
p {
|
|
164
|
+
color: #86909c;
|
|
165
|
+
margin-bottom: 1.5rem;
|
|
166
|
+
line-height: 1.6;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.demo-container {
|
|
171
|
+
position: relative;
|
|
172
|
+
height: 100px;
|
|
173
|
+
background: #f7f8fa;
|
|
174
|
+
border: 1px dashed #c9cdd4;
|
|
175
|
+
border-radius: 6px;
|
|
176
|
+
margin: 1rem 0;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.comparison {
|
|
180
|
+
margin-top: 2rem;
|
|
181
|
+
|
|
182
|
+
.comparison-item {
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
margin: 0.5rem 0;
|
|
186
|
+
padding: 0.5rem;
|
|
187
|
+
background: #f7f8fa;
|
|
188
|
+
border-radius: 4px;
|
|
189
|
+
|
|
190
|
+
.label {
|
|
191
|
+
min-width: 150px;
|
|
192
|
+
font-weight: 600;
|
|
193
|
+
color: #4e5969;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.global-text {
|
|
197
|
+
// 这个会显示全局默认的 14px
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.utility-tests {
|
|
203
|
+
display: grid;
|
|
204
|
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
205
|
+
gap: 1.5rem;
|
|
206
|
+
|
|
207
|
+
.test-group {
|
|
208
|
+
padding: 1rem;
|
|
209
|
+
background: #f7f8fa;
|
|
210
|
+
border-radius: 6px;
|
|
211
|
+
|
|
212
|
+
h4 {
|
|
213
|
+
margin-bottom: 1rem;
|
|
214
|
+
color: #1d2129;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
> div {
|
|
218
|
+
margin: 0.5rem 0;
|
|
219
|
+
padding: 0.25rem 0;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.isolation-demo {
|
|
225
|
+
display: grid;
|
|
226
|
+
grid-template-columns: 1fr 1fr;
|
|
227
|
+
gap: 2rem;
|
|
228
|
+
|
|
229
|
+
.normal-container,
|
|
230
|
+
.component-isolation {
|
|
231
|
+
padding: 1.5rem;
|
|
232
|
+
border: 1px solid #e5e6eb;
|
|
233
|
+
border-radius: 6px;
|
|
234
|
+
|
|
235
|
+
.test-element {
|
|
236
|
+
padding: 1rem;
|
|
237
|
+
background: #e3f2fd;
|
|
238
|
+
border-radius: 4px;
|
|
239
|
+
margin-top: 1rem;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.normal-container {
|
|
244
|
+
background: #fff3e0;
|
|
245
|
+
|
|
246
|
+
h4 {
|
|
247
|
+
color: #f57c00;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.component-isolation {
|
|
252
|
+
background: #e8f5e8;
|
|
253
|
+
|
|
254
|
+
h4 {
|
|
255
|
+
color: #2e7d32;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.test-results {
|
|
261
|
+
margin-top: 3rem;
|
|
262
|
+
padding: 2rem;
|
|
263
|
+
background: #f0f9ff;
|
|
264
|
+
border: 1px solid #bfdbfe;
|
|
265
|
+
border-radius: 8px;
|
|
266
|
+
|
|
267
|
+
h2 {
|
|
268
|
+
color: #1e40af;
|
|
269
|
+
margin-bottom: 1.5rem;
|
|
270
|
+
border-bottom: 2px solid #3b82f6;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.result-item {
|
|
274
|
+
margin: 1rem 0;
|
|
275
|
+
padding: 0.75rem;
|
|
276
|
+
background: white;
|
|
277
|
+
border-radius: 4px;
|
|
278
|
+
border-left: 4px solid #3b82f6;
|
|
279
|
+
|
|
280
|
+
strong {
|
|
281
|
+
color: #1e40af;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// 测试全局样式是否被正确隔离
|
|
288
|
+
.test-element {
|
|
289
|
+
font-size: 18px; // 这个应该在隔离容器中被重置
|
|
290
|
+
color: red; // 这个应该在隔离容器中被重置
|
|
291
|
+
}
|
|
292
|
+
</style>
|
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="demo-page">
|
|
3
|
+
<BannerPage
|
|
4
|
+
v-model="bannerPageData"
|
|
5
|
+
></BannerPage>
|
|
6
|
+
|
|
7
|
+
<CustomSpace
|
|
8
|
+
v-model="customSpaceData"
|
|
9
|
+
></CustomSpace>
|
|
10
|
+
|
|
11
|
+
<HeroSlide
|
|
12
|
+
v-model="heroSlideData"
|
|
13
|
+
></HeroSlide>
|
|
14
|
+
|
|
15
|
+
<BannerImage
|
|
16
|
+
v-model="bannerImageData"
|
|
17
|
+
></BannerImage>
|
|
18
|
+
|
|
3
19
|
<ArticleList
|
|
4
20
|
v-model="articleListData"
|
|
5
|
-
|
|
6
|
-
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<QuoteText
|
|
24
|
+
v-model="quoteTextData"
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<GalleryList
|
|
28
|
+
v-model="galleryListData"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
<BtnList
|
|
32
|
+
v-model="btnListData"
|
|
33
|
+
/>
|
|
34
|
+
|
|
35
|
+
<LinkList
|
|
36
|
+
v-model="linkListData"
|
|
7
37
|
/>
|
|
8
38
|
</div>
|
|
9
39
|
</template>
|
|
@@ -11,22 +41,31 @@
|
|
|
11
41
|
<script setup lang="ts">
|
|
12
42
|
import { ref } from 'vue'
|
|
13
43
|
import ArticleList from '@/components/ArticleList/index.vue'
|
|
44
|
+
import BannerPage from '@/components/BannerPage/index.vue'
|
|
45
|
+
import CustomSpace from '@/components/CustomSpace/index.vue'
|
|
46
|
+
import HeroSlide from '@/components/HeroSlide/index.vue'
|
|
47
|
+
import BannerImage from '@/components/BannerImage/index.vue'
|
|
48
|
+
import QuoteText from '@/components/QuoteText/index.vue'
|
|
49
|
+
import GalleryList from '@/components/GalleryList/index.vue'
|
|
50
|
+
import BtnList from '@/components/BtnList/index.vue'
|
|
51
|
+
import LinkList from '@/components/LinkLIst/index.vue'
|
|
14
52
|
|
|
15
53
|
const articleListData = ref()
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
54
|
+
const bannerPageData = ref()
|
|
55
|
+
const customSpaceData = ref()
|
|
56
|
+
const heroSlideData = ref()
|
|
57
|
+
const bannerImageData = ref()
|
|
58
|
+
const quoteTextData = ref()
|
|
59
|
+
const galleryListData = ref()
|
|
60
|
+
const btnListData = ref()
|
|
61
|
+
const linkListData = ref()
|
|
24
62
|
</script>
|
|
25
63
|
|
|
26
64
|
<style scoped>
|
|
27
65
|
.demo-page {
|
|
28
66
|
background: #fff;
|
|
29
67
|
}
|
|
68
|
+
|
|
30
69
|
.description {
|
|
31
70
|
font-size: 16px;
|
|
32
71
|
line-height: 1.6;
|