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.
Files changed (73) hide show
  1. package/dist/index-Ch_ldWmA.js +1 -0
  2. package/dist/index-DXm2cqxo.mjs +485 -0
  3. package/dist/official-block.cjs.js +74 -74
  4. package/dist/official-block.es.js +13577 -10832
  5. package/dist/official-block.umd.js +78 -78
  6. package/dist/style.css +1 -1
  7. package/dist/swiper-JiLDDxAF.js +1 -0
  8. package/dist/swiper-acbnDJoL.mjs +2035 -0
  9. package/dist/utils-DD-vVZej.mjs +316 -0
  10. package/dist/utils-DOLLD0-F.js +1 -0
  11. package/package.json +2 -1
  12. package/src/components/ArticleList/article.vue +3 -3
  13. package/src/components/ArticleList/contact.vue +9 -9
  14. package/src/components/ArticleList/index.ts +1 -1
  15. package/src/components/ArticleList/index.vue +24 -82
  16. package/src/components/ArticleList/setting.vue +61 -71
  17. package/src/components/ArticleList/type.ts +12 -18
  18. package/src/components/BannerImage/index.ts +11 -0
  19. package/src/components/BannerImage/index.vue +153 -0
  20. package/src/components/BannerImage/setting.vue +55 -0
  21. package/src/components/BannerImage/type.ts +10 -0
  22. package/src/components/BannerPage/index.ts +11 -0
  23. package/src/components/BannerPage/index.vue +283 -0
  24. package/src/components/BannerPage/setting.vue +55 -0
  25. package/src/components/BannerPage/type.ts +10 -0
  26. package/src/components/BtnList/index.ts +11 -0
  27. package/src/components/BtnList/index.vue +588 -0
  28. package/src/components/BtnList/setting.vue +255 -0
  29. package/src/components/BtnList/type.ts +10 -0
  30. package/src/components/Button/index.vue +45 -33
  31. package/src/components/CustomSpace/index.ts +11 -0
  32. package/src/components/CustomSpace/index.vue +82 -0
  33. package/src/components/CustomSpace/setting.vue +89 -0
  34. package/src/components/CustomSpace/type.ts +10 -0
  35. package/src/components/GalleryList/index.ts +12 -0
  36. package/src/components/GalleryList/index.vue +311 -0
  37. package/src/components/GalleryList/setting.vue +268 -0
  38. package/src/components/GalleryList/type.ts +10 -0
  39. package/src/components/HeroSlide/index.ts +1 -1
  40. package/src/components/HeroSlide/index.vue +85 -133
  41. package/src/components/HeroSlide/setting.vue +435 -0
  42. package/src/components/HeroSlide/type.ts +5 -14
  43. package/src/components/LinkLIst/index.ts +11 -0
  44. package/src/components/LinkLIst/index.vue +317 -0
  45. package/src/components/LinkLIst/setting.vue +264 -0
  46. package/src/components/LinkLIst/type.ts +10 -0
  47. package/src/components/Media/index.vue +18 -18
  48. package/src/components/Operate/index.vue +17 -7
  49. package/src/components/Profile/index.vue +999 -0
  50. package/src/components/Profile/modal.vue +56 -0
  51. package/src/components/Profile/setting.vue +330 -0
  52. package/src/components/QuickLinks/index.vue +166 -0
  53. package/src/components/QuoteText/index.ts +11 -0
  54. package/src/components/QuoteText/index.vue +133 -0
  55. package/src/components/QuoteText/setting.vue +81 -0
  56. package/src/components/QuoteText/type.ts +10 -0
  57. package/src/components/ScrollKeyInfo/index.vue +0 -0
  58. package/src/components/Swiper/index.vue +538 -0
  59. package/src/components/index.ts +23 -5
  60. package/src/index.ts +56 -12
  61. package/src/main.ts +6 -3
  62. package/src/router/index.ts +6 -0
  63. package/src/style.css +17 -0
  64. package/src/styles/component-isolation.scss +256 -0
  65. package/src/styles/editor.scss +1 -1
  66. package/src/styles/layers.scss +256 -0
  67. package/src/styles/main.scss +21687 -0
  68. package/src/styles/mixins/style-isolation.scss +262 -0
  69. package/src/styles/smart-reset.scss +287 -0
  70. package/src/styles/test.scss +1 -1
  71. package/src/types/button.ts +10 -0
  72. package/src/views/StyleIsolationTest.vue +292 -0
  73. package/src/views/components/ArticleListDemo.vue +49 -10
@@ -56,21 +56,21 @@
56
56
 
57
57
  <template v-if="item.type === 'Article'">
58
58
  <p class="item-title">标题</p>
59
- <a-input v-model="item.data.title" placeholder="请输入标题" allow-clear />
59
+ <a-input v-model="item.title" placeholder="请输入标题" allow-clear />
60
60
 
61
61
  <p class="item-title">内容</p>
62
- <RichTextEditor v-model="item.data.content"></RichTextEditor>
62
+ <RichTextEditor v-model="item.content"></RichTextEditor>
63
63
 
64
64
  <p class="item-title">按钮</p>
65
65
  <draggable
66
- v-model="item.data.buttonList"
66
+ v-model="item.buttonList"
67
67
  :component-data="{
68
68
  tag: 'div',
69
69
  type: 'transition-group',
70
70
  name: !drag ? 'flip-list' : null
71
71
  }"
72
72
  v-bind="buttonDragOptions"
73
- :disabled="!shouldShowDragHandle(item.data.buttonList)"
73
+ :disabled="!shouldShowDragHandle(item.buttonList)"
74
74
  @start="drag = true"
75
75
  @end="drag = false"
76
76
  item-key="id"
@@ -78,17 +78,17 @@
78
78
  <template #item="{ element: button }">
79
79
  <div
80
80
  class="item-button draggable-item"
81
- :class="{ 'sortable-disabled': !shouldShowDragHandle(item.data.buttonList) }"
81
+ :class="{ 'sortable-disabled': !shouldShowDragHandle(item.buttonList) }"
82
82
  :key="button.id"
83
83
  >
84
84
  <div class="btn-group">
85
85
  <div
86
- v-if="shouldShowDragHandle(item.data.buttonList)"
86
+ v-if="shouldShowDragHandle(item.buttonList)"
87
87
  class="drag-handle"
88
88
  >
89
89
  <icon-drag-arrow class="drag-icon" />
90
90
  </div>
91
- <icon-delete class="btn-delete" @click="handleDeleteButton(item.data.buttonList, button.id)" />
91
+ <icon-delete class="btn-delete" @click="handleDeleteButton(item.buttonList, button.id)" />
92
92
  </div>
93
93
  <a-button type="primary">{{ button.text }}</a-button>
94
94
  <div class="item-action flex items-center">
@@ -99,21 +99,21 @@
99
99
  </div>
100
100
  </template>
101
101
  </draggable>
102
- <div class="item-add-btn flex items-center" @click="handleAddButton(item.data.buttonList)">
102
+ <div class="item-add-btn flex items-center" @click="handleAddButton(item.buttonList)">
103
103
  <icon-plus />
104
104
  <span class="btn-text">添加按钮</span>
105
105
  </div>
106
106
 
107
107
  <p class="item-title">链接</p>
108
108
  <draggable
109
- v-model="item.data.linkList"
109
+ v-model="item.linkList"
110
110
  :component-data="{
111
111
  tag: 'div',
112
112
  type: 'transition-group',
113
113
  name: !drag ? 'flip-list' : null
114
114
  }"
115
115
  v-bind="linkDragOptions"
116
- :disabled="!shouldShowDragHandle(item.data.linkList)"
116
+ :disabled="!shouldShowDragHandle(item.linkList)"
117
117
  @start="drag = true"
118
118
  @end="drag = false"
119
119
  item-key="id"
@@ -121,17 +121,17 @@
121
121
  <template #item="{ element: link }">
122
122
  <div
123
123
  class="item-button draggable-item"
124
- :class="{ 'sortable-disabled': !shouldShowDragHandle(item.data.linkList) }"
124
+ :class="{ 'sortable-disabled': !shouldShowDragHandle(item.linkList) }"
125
125
  :key="link.id"
126
126
  >
127
127
  <div class="btn-group">
128
128
  <div
129
- v-if="shouldShowDragHandle(item.data.linkList)"
129
+ v-if="shouldShowDragHandle(item.linkList)"
130
130
  class="drag-handle"
131
131
  >
132
132
  <icon-drag-arrow class="drag-icon" />
133
133
  </div>
134
- <icon-delete class="btn-delete" @click="handleDeleteLink(item.data.linkList, link.id)" />
134
+ <icon-delete class="btn-delete" @click="handleDeleteLink(item.linkList, link.id)" />
135
135
  </div>
136
136
 
137
137
  <a-link href="link">{{ link.text }}</a-link>
@@ -143,7 +143,7 @@
143
143
  </div>
144
144
  </template>
145
145
  </draggable>
146
- <div class="item-add-btn flex items-center" @click="handleAddLink(item.data.linkList)">
146
+ <div class="item-add-btn flex items-center" @click="handleAddLink(item.linkList)">
147
147
  <icon-plus />
148
148
  <span class="btn-text">添加链接</span>
149
149
  </div>
@@ -151,21 +151,21 @@
151
151
 
152
152
  <template v-if="item.type === 'Contact'">
153
153
  <p class="item-title">标题</p>
154
- <a-input v-model="item.data.title" placeholder="请输入标题" allow-clear />
154
+ <a-input v-model="item.title" placeholder="请输入标题" allow-clear />
155
155
 
156
156
  <p class="item-title">内容</p>
157
- <RichTextEditor v-model="item.data.content"></RichTextEditor>
157
+ <RichTextEditor v-model="item.content"></RichTextEditor>
158
158
 
159
159
  <p class="item-title">分类</p>
160
160
  <draggable
161
- v-model="item.data.categories"
161
+ v-model="item.categories"
162
162
  :component-data="{
163
163
  tag: 'div',
164
164
  type: 'transition-group',
165
165
  name: !drag ? 'flip-list' : null
166
166
  }"
167
167
  v-bind="categoryDragOptions"
168
- :disabled="!shouldShowDragHandle(item.data.categories)"
168
+ :disabled="!shouldShowDragHandle(item.categories)"
169
169
  @start="drag = true"
170
170
  @end="drag = false"
171
171
  item-key="id"
@@ -173,19 +173,19 @@
173
173
  <template #item="{ element: category }">
174
174
  <div
175
175
  class="item-button draggable-item"
176
- :class="{ 'sortable-disabled': !shouldShowDragHandle(item.data.categories) }"
176
+ :class="{ 'sortable-disabled': !shouldShowDragHandle(item.categories) }"
177
177
  :key="category.id"
178
178
  >
179
179
  <div class="btn-group">
180
180
  <div
181
- v-if="shouldShowDragHandle(item.data.categories)"
181
+ v-if="shouldShowDragHandle(item.categories)"
182
182
  class="drag-handle"
183
183
  >
184
184
  <icon-drag-arrow class="drag-icon" />
185
185
  </div>
186
- <icon-delete class="btn-delete" @click="handleDeleteCategory(item.data.categories, category.id)" />
186
+ <icon-delete class="btn-delete" @click="handleDeleteCategory(item.categories, category.id)" />
187
187
  </div>
188
- <icon-delete class="btn-delete" @click="handleDeleteCategory(item.data.categories, category.id)" />
188
+ <icon-delete class="btn-delete" @click="handleDeleteCategory(item.categories, category.id)" />
189
189
  <a-link href="link">{{ category.text }}</a-link>
190
190
  <div class="item-action flex items-center">
191
191
  <a-input v-model="category.text" placeholder="分类名称" allow-clear />
@@ -193,21 +193,21 @@
193
193
  </div>
194
194
  </template>
195
195
  </draggable>
196
- <div class="item-add-btn flex items-center" @click="handleAddCategory(item.data.categories)">
196
+ <div class="item-add-btn flex items-center" @click="handleAddCategory(item.categories)">
197
197
  <icon-plus />
198
198
  <span class="btn-text">添加分类</span>
199
199
  </div>
200
200
 
201
201
  <p class="item-title">链接</p>
202
202
  <draggable
203
- v-model="item.data.linkList"
203
+ v-model="item.linkList"
204
204
  :component-data="{
205
205
  tag: 'div',
206
206
  type: 'transition-group',
207
207
  name: !drag ? 'flip-list' : null
208
208
  }"
209
209
  v-bind="linkDragOptions"
210
- :disabled="!shouldShowDragHandle(item.data.linkList)"
210
+ :disabled="!shouldShowDragHandle(item.linkList)"
211
211
  @start="drag = true"
212
212
  @end="drag = false"
213
213
  item-key="id"
@@ -215,17 +215,17 @@
215
215
  <template #item="{ element: link }">
216
216
  <div
217
217
  class="item-button draggable-item"
218
- :class="{ 'sortable-disabled': !shouldShowDragHandle(item.data.linkList) }"
218
+ :class="{ 'sortable-disabled': !shouldShowDragHandle(item.linkList) }"
219
219
  :key="link.id"
220
220
  >
221
221
  <div class="btn-group">
222
222
  <div
223
- v-if="shouldShowDragHandle(item.data.linkList)"
223
+ v-if="shouldShowDragHandle(item.linkList)"
224
224
  class="drag-handle"
225
225
  >
226
226
  <icon-drag-arrow class="drag-icon" />
227
227
  </div>
228
- <icon-delete class="btn-delete" @click="handleDeleteLink(item.data.linkList, link.id)" />
228
+ <icon-delete class="btn-delete" @click="handleDeleteLink(item.linkList, link.id)" />
229
229
  </div>
230
230
  <a-link href="link">{{ link.text }}</a-link>
231
231
  <div class="item-action flex items-center">
@@ -236,35 +236,35 @@
236
236
  </div>
237
237
  </template>
238
238
  </draggable>
239
- <div class="item-add-btn flex items-center" @click="handleAddLink(item.data.linkList)">
239
+ <div class="item-add-btn flex items-center" @click="handleAddLink(item.linkList)">
240
240
  <icon-plus />
241
241
  <span class="btn-text">添加链接</span>
242
242
  </div>
243
243
  </template>
244
244
 
245
245
  <template v-if="item.type === 'Image'">
246
- <img class="item-img" :src="item.data.imgSrc" />
246
+ <img class="item-img" :src="item.imgSrc" />
247
247
  <div class="item-uplaod flex items-center">
248
- <a-input v-model="item.data.imgSrc" placeholder="请输入标题" allow-clear />
248
+ <a-input v-model="item.imgSrc" placeholder="请输入标题" allow-clear />
249
249
  <a-upload class="fit-content" :show-file-list="false" action="/" />
250
250
  </div>
251
- <a-input class="mt-10" v-model="item.data.caption" placeholder="图片描述" allow-clear />
252
- <a-input class="mt-10" v-model="item.data.alt" placeholder="图片alt" allow-clear />
253
- <a-checkbox class="pt-10" :model-value="item.data.isRound">圆角</a-checkbox>
251
+ <a-input class="mt-2" v-model="item.caption" placeholder="图片描述" allow-clear />
252
+ <a-input class="mt-2" v-model="item.alt" placeholder="图片alt" allow-clear />
253
+ <a-checkbox class="pt-2" :model-value="item.isRound">圆角</a-checkbox>
254
254
  </template>
255
255
 
256
256
  <template v-if="item.type === 'ImageList'">
257
257
  <p class="item-title">图片组</p>
258
258
  <div class="item-img-list">
259
259
  <draggable
260
- v-model="item.data.imageList"
260
+ v-model="item.imageList"
261
261
  :component-data="{
262
262
  tag: 'div',
263
263
  type: 'transition-group',
264
264
  name: !drag ? 'flip-list' : null
265
265
  }"
266
266
  v-bind="imageDragOptions"
267
- :disabled="!shouldShowDragHandle(item.data.imageList)"
267
+ :disabled="!shouldShowDragHandle(item.imageList)"
268
268
  @start="drag = true"
269
269
  @end="drag = false"
270
270
  item-key="id"
@@ -272,21 +272,21 @@
272
272
  <template #item="{ element: img }">
273
273
  <div
274
274
  class="img-list-item flex draggable-item"
275
- :class="{ 'sortable-disabled': !shouldShowDragHandle(item.data.imageList) }"
275
+ :class="{ 'sortable-disabled': !shouldShowDragHandle(item.imageList) }"
276
276
  :key="img.id"
277
277
  >
278
278
  <div class="btn-group">
279
279
  <div
280
- v-if="shouldShowDragHandle(item.data.imageList)"
280
+ v-if="shouldShowDragHandle(item.imageList)"
281
281
  class="drag-handle"
282
282
  >
283
283
  <icon-drag-arrow class="drag-icon" />
284
284
  </div>
285
- <icon-delete class="btn-delete" @click="handleDeleteImage(item.data.imageList, img.id)" />
285
+ <icon-delete class="btn-delete" @click="handleDeleteImage(item.imageList, img.id)" />
286
286
  </div>
287
287
 
288
288
  <div class="item-img-box" v-if="img.src">
289
- <!-- <icon-close-circle-fill class="item-img-dlete" @click="handleDeleteImage(item.data.imageList, img.id)" /> -->
289
+ <!-- <icon-close-circle-fill class="item-img-dlete" @click="handleDeleteImage(item.imageList, img.id)" /> -->
290
290
  <img class="item-img small-img" :src="img.src" />
291
291
  </div>
292
292
 
@@ -298,7 +298,7 @@
298
298
  </template>
299
299
  </draggable>
300
300
  </div>
301
- <div class="item-add-btn flex items-center" @click="handleAddImage(item.data.imageList)">
301
+ <div class="item-add-btn flex items-center" @click="handleAddImage(item.imageList)">
302
302
  <icon-plus />
303
303
  <span class="btn-text">添加图片</span>
304
304
  </div>
@@ -306,14 +306,14 @@
306
306
 
307
307
  <template v-if="item.type === 'Video'">
308
308
  <p class="item-title">视频</p>
309
- <video class="item-img" :src="item.data.videoSrc" controls></video>
309
+ <video class="item-img" :src="item.videoSrc" controls></video>
310
310
  <div class="item-uplaod flex items-center">
311
- <a-input v-model="item.data.videoSrc" placeholder="请输入视频链接" allow-clear />
311
+ <a-input v-model="item.videoSrc" placeholder="请输入视频链接" allow-clear />
312
312
  <a-upload class="fit-content" :show-file-list="false" action="/" />
313
313
  </div>
314
- <img class="item-img" :src="item.data.imgSrc" />
314
+ <img class="item-img" :src="item.imgSrc" />
315
315
  <div class="item-uplaod flex items-center">
316
- <a-input v-model="item.data.imgSrc" placeholder="视频封面" allow-clear />
316
+ <a-input v-model="item.imgSrc" placeholder="视频封面" allow-clear />
317
317
  <a-upload class="fit-content" :show-file-list="false" action="/" />
318
318
  </div>
319
319
  </template>
@@ -337,7 +337,7 @@ const drag = ref(false)
337
337
  // 不同类型的拖拽配置选项
338
338
  const dragOptions = computed(() => ({
339
339
  animation: 200,
340
- group: 'item', // 按钮专用分组
340
+ group: 'item',
341
341
  disabled: false,
342
342
  ghostClass: 'ghost'
343
343
  }))
@@ -399,51 +399,41 @@ const handleAdd = (type: string) => {
399
399
  detail.data.push({
400
400
  id: randomString(),
401
401
  type: 'Article',
402
- data: {
403
- title: '',
404
- content: '',
405
- buttonList: [],
406
- linkList: []
407
- }
402
+ title: '',
403
+ content: '',
404
+ buttonList: [],
405
+ linkList: []
408
406
  })
409
407
  } else if (type === 'Contact') {
410
408
  detail.data.push({
411
409
  id: randomString(),
412
410
  type: 'Contact',
413
- data: {
414
- title: '',
415
- content: '',
416
- categories: [],
417
- linkList: []
418
- }
411
+ title: '',
412
+ content: '',
413
+ categories: [],
414
+ linkList: []
419
415
  })
420
416
  } else if (type === 'Image') {
421
417
  detail.data.push({
422
418
  id: randomString(),
423
419
  type: 'Image',
424
- data: {
425
- imgSrc: '',
426
- caption: '',
427
- alt: '',
428
- isRound: false
429
- }
420
+ imgSrc: '',
421
+ caption: '',
422
+ alt: '',
423
+ isRound: false
430
424
  })
431
425
  } else if (type === 'ImageList') {
432
426
  detail.data.push({
433
427
  id: randomString(),
434
428
  type: 'ImageList',
435
- data: {
436
- imageList: []
437
- }
429
+ imageList: []
438
430
  })
439
431
  } else if (type === 'Video') {
440
432
  detail.data.push({
441
433
  id: randomString(),
442
434
  type: 'Video',
443
- data: {
444
- videoSrc: '',
445
- imgSrc: ''
446
- }
435
+ videoSrc: '',
436
+ imgSrc: ''
447
437
  })
448
438
  }
449
439
  }
@@ -1,23 +1,17 @@
1
- import type { VNode } from 'vue';
2
-
3
- export interface ComponentProps {
4
- /** 控制组件尺寸 */
5
- size?: 'small' | 'medium' | 'large'
6
- /** 是否禁用状态 */
7
- disabled?: boolean
1
+ export interface ArticleListProps {
8
2
  /** 双向绑定的值 */
9
- modelValue: string | number
3
+ modelValue: any
10
4
  }
11
5
 
12
- export interface ComponentEmits {
13
- (e: 'update:modelValue', value: string | number): void
14
- (e: 'change', value: string | number): void
15
- (e: 'focus', event: FocusEvent): void
6
+ export interface ArticleListEmits {
7
+ (e: 'update:modelValue', value: any): void
8
+ (e: 'handleDelete', value: string | number): void
9
+ (e: 'handleCopy', value: any): void
16
10
  }
17
11
 
18
- export type ComponentSlots = {
19
- /** 默认插槽内容 */
20
- default?: (props: { value: string | number }) => VNode[]
21
- /** 头部内容 */
22
- header?: (props: { title: string }) => VNode[]
23
- }
12
+ // export type ComponentSlots = {
13
+ // /** 默认插槽内容 */
14
+ // default?: (props: { value: string | number }) => VNode[]
15
+ // /** 头部内容 */
16
+ // header?: (props: { title: string }) => VNode[]
17
+ // }
@@ -0,0 +1,11 @@
1
+ import type { App, Plugin } from 'vue'
2
+ import BannerImage from './index.vue'
3
+
4
+ export default {
5
+ install: (app: App) => {
6
+ app.component('BannerImage', BannerImage)
7
+ },
8
+ } satisfies Plugin
9
+
10
+ export { default as BannerImage } from './index.vue'
11
+ export type { BannerImageProps, BannerImageEmits } from './type'
@@ -0,0 +1,153 @@
1
+ <template>
2
+ <div class="banner-image" @mouseenter="isHover = true" @mouseleave="isHover = false">
3
+ <div class="banner-image__image"
4
+ :style="{backgroundImage: 'url(' + modelValue?.data?.imgSrc + ')', 'background-position': 'center'}"
5
+ >
6
+ <div class="banner-image__title is-zh">
7
+ {{ modelValue?.data?.title }}
8
+ </div>
9
+ </div>
10
+
11
+ <Operate v-if="!modelValue?.readOnly" v-model:show="isHover" @handle-edit="showSetting = true" @handle-delete="handleDelete" @handle-copy="handleCopy"></Operate>
12
+ </div>
13
+
14
+ <Setting v-model:show="showSetting" :data="modelValue"></Setting>
15
+ </template>
16
+
17
+ <script lang="ts" setup>
18
+ import { ref } from 'vue'
19
+ import { randomString } from '@/utils/common'
20
+ import Operate from '@/components/Operate/index.vue'
21
+ import Setting from './setting.vue'
22
+
23
+
24
+ // 定义组件名称
25
+ defineOptions({
26
+ name: 'BannerImage'
27
+ })
28
+
29
+ const props = defineProps({
30
+ modelValue: {
31
+ type: Object,
32
+ default: () => {}
33
+ },
34
+
35
+ // 是否预览
36
+ isPreview: {
37
+ type: Boolean,
38
+ default: false
39
+ }
40
+ })
41
+
42
+ const emit = defineEmits(['update:modelValue', 'handleDelete', 'handleCopy'])
43
+
44
+ const handleInit = () => {
45
+ if (props.modelValue && props.modelValue.data) return // 有数据不用初始化
46
+ const data = {
47
+ id: props.modelValue?.id || randomString(),
48
+ type: 'BannerImage',
49
+ readOnly: props.modelValue?.readOnly || false,
50
+ data: {
51
+ title: 'About YWIES',
52
+ imgSrc: 'https://osswebsite-test.cedim.cn/ywies-tx/static-images/about-ywies/01_About_YWIES_1_Header.jpg'
53
+ }
54
+ }
55
+ emit('update:modelValue', data)
56
+ }
57
+
58
+ const isHover = ref<boolean>(false);
59
+ const showSetting = ref<boolean>(false);
60
+
61
+ const handleDelete = () => {
62
+ emit('handleDelete', props.modelValue.id)
63
+ }
64
+
65
+ const handleCopy = () => {
66
+ emit('handleCopy', props.modelValue)
67
+ }
68
+
69
+ handleInit()
70
+ </script>
71
+
72
+ <style lang="scss" scoped>
73
+ .banner-image {
74
+ position: relative;
75
+ }
76
+
77
+ .banner-image__image {
78
+ height: 340px;
79
+ background-size: cover;
80
+ background-repeat: no-repeat;
81
+ background-image: linear-gradient(184.08deg,rgba(0,0,0,.427) 21.79%,transparent 96.67%),var(--bg-image);
82
+ display: flex;
83
+ flex-direction: column;
84
+ align-items: center;
85
+ }
86
+
87
+ @media (max-width: 1279.98px) {
88
+ .banner-image__image {
89
+ height: clamp(200px,(100vw - 576px)/5 + 200px,340px);
90
+ }
91
+ }
92
+
93
+ @media (max-width: 575.98px) {
94
+ .banner-image__image {
95
+ height: 200px;
96
+ }
97
+ }
98
+
99
+ .banner-image.has-quick-links {
100
+ padding-bottom: 38px;
101
+ }
102
+
103
+ .banner-image__title {
104
+ font-size: 60px;
105
+ line-height: 1.166;
106
+ font-weight: 500;
107
+ color: #fff;
108
+ text-shadow: 0 0 10px rgba(130,130,140,.12);
109
+ padding-top: 166px;
110
+ }
111
+
112
+ @media (max-width: 1279.98px) {
113
+ .banner-image__title {
114
+ padding-top: clamp(106px,(100vw - 576px)/11.73 + 106px,166px);
115
+ }
116
+ }
117
+
118
+ @media (max-width: 1023.98px) {
119
+ .banner-image__title {
120
+ font-size: 36px;
121
+ }
122
+ }
123
+
124
+ @media (max-width: 575.98px) {
125
+ .banner-image__title {
126
+ font-size: 40px;
127
+ font-weight: 500;
128
+ line-height: 1.2;
129
+ letter-spacing: .02em;
130
+ padding-top: 106px;
131
+ }
132
+ }
133
+
134
+ @media (max-width: 575.98px) and (max-width: 1023.98px) {
135
+ .banner-image__title {
136
+ font-size: 32px;
137
+ font-weight: 500;
138
+ line-height: 1.2;
139
+ letter-spacing: .02em;
140
+ }
141
+ }
142
+
143
+ @media (max-width: 575.98px) and (max-width: 767.98px) {
144
+ .banner-image__title {
145
+ font-size: 24px;
146
+ line-height: 1.09;
147
+ }
148
+ }
149
+
150
+ .banner-image__title.is-zh {
151
+ font-weight: 700;
152
+ }
153
+ </style>
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <a-drawer :width="500" :visible="show" :footer="false" @cancel="handleCancel" unmountOnClose>
3
+ <template #title>
4
+ {{data.type}}组件编辑
5
+ </template>
6
+ <div class="setting-content">
7
+ <p class="item-title">标题</p>
8
+ <a-input v-model="data.data.title" placeholder="请输入标题" allow-clear />
9
+
10
+ <p class="item-title">图片</p>
11
+ <img class="item-img" :src="data?.data?.imgSrc" />
12
+ <div class="item-uplaod flex items-center">
13
+ <a-input v-model="data.data.imgSrc" placeholder="请输入图片链接" allow-clear />
14
+ <a-upload class="fit-content" :show-file-list="false" action="/" />
15
+ </div>
16
+ </div>
17
+ </a-drawer>
18
+ </template>
19
+
20
+ <script lang="ts" setup>
21
+ defineProps({
22
+ show: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+
27
+ data: {
28
+ type: Object,
29
+ default: () => {}
30
+ }
31
+ })
32
+
33
+ const emit = defineEmits(['update:show']);
34
+
35
+ const handleCancel = () => {
36
+ emit('update:show', false);
37
+ }
38
+ </script>
39
+
40
+ <style lang="scss" scoped>
41
+ .setting-content {
42
+ position: relative;
43
+
44
+ .item-title {
45
+ padding: 12px 0 8px 0;
46
+ font-size: 14px;
47
+ font-weight: 600;
48
+ }
49
+
50
+ .item-img {
51
+ margin-top: 12px;
52
+ height: 160px;
53
+ }
54
+ }
55
+ </style>
@@ -0,0 +1,10 @@
1
+ export interface BannerImageProps {
2
+ /** 双向绑定的值 */
3
+ modelValue: any
4
+ }
5
+
6
+ export interface BannerImageEmits {
7
+ (e: 'update:modelValue', value: any): void
8
+ (e: 'handleDelete', value: string | number): void
9
+ (e: 'handleCopy', value: any): void
10
+ }
@@ -0,0 +1,11 @@
1
+ import type { App, Plugin } from 'vue'
2
+ import BannerPage from './index.vue'
3
+
4
+ export default {
5
+ install: (app: App) => {
6
+ app.component('BannerPage', BannerPage)
7
+ },
8
+ } satisfies Plugin
9
+
10
+ export { default as BannerPage } from './index.vue'
11
+ export type { BannerPageProps, BannerPageEmits } from './type'