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
@@ -0,0 +1,316 @@
1
+ function w(e) {
2
+ return e !== null && typeof e == "object" && "constructor" in e && e.constructor === Object;
3
+ }
4
+ function p(e, t) {
5
+ e === void 0 && (e = {}), t === void 0 && (t = {});
6
+ const r = ["__proto__", "constructor", "prototype"];
7
+ Object.keys(t).filter((n) => r.indexOf(n) < 0).forEach((n) => {
8
+ typeof e[n] > "u" ? e[n] = t[n] : w(t[n]) && w(e[n]) && Object.keys(t[n]).length > 0 && p(e[n], t[n]);
9
+ });
10
+ }
11
+ const E = {
12
+ body: {},
13
+ addEventListener() {
14
+ },
15
+ removeEventListener() {
16
+ },
17
+ activeElement: {
18
+ blur() {
19
+ },
20
+ nodeName: ""
21
+ },
22
+ querySelector() {
23
+ return null;
24
+ },
25
+ querySelectorAll() {
26
+ return [];
27
+ },
28
+ getElementById() {
29
+ return null;
30
+ },
31
+ createEvent() {
32
+ return {
33
+ initEvent() {
34
+ }
35
+ };
36
+ },
37
+ createElement() {
38
+ return {
39
+ children: [],
40
+ childNodes: [],
41
+ style: {},
42
+ setAttribute() {
43
+ },
44
+ getElementsByTagName() {
45
+ return [];
46
+ }
47
+ };
48
+ },
49
+ createElementNS() {
50
+ return {};
51
+ },
52
+ importNode() {
53
+ return null;
54
+ },
55
+ location: {
56
+ hash: "",
57
+ host: "",
58
+ hostname: "",
59
+ href: "",
60
+ origin: "",
61
+ pathname: "",
62
+ protocol: "",
63
+ search: ""
64
+ }
65
+ };
66
+ function O() {
67
+ const e = typeof document < "u" ? document : {};
68
+ return p(e, E), e;
69
+ }
70
+ const T = {
71
+ document: E,
72
+ navigator: {
73
+ userAgent: ""
74
+ },
75
+ location: {
76
+ hash: "",
77
+ host: "",
78
+ hostname: "",
79
+ href: "",
80
+ origin: "",
81
+ pathname: "",
82
+ protocol: "",
83
+ search: ""
84
+ },
85
+ history: {
86
+ replaceState() {
87
+ },
88
+ pushState() {
89
+ },
90
+ go() {
91
+ },
92
+ back() {
93
+ }
94
+ },
95
+ CustomEvent: function() {
96
+ return this;
97
+ },
98
+ addEventListener() {
99
+ },
100
+ removeEventListener() {
101
+ },
102
+ getComputedStyle() {
103
+ return {
104
+ getPropertyValue() {
105
+ return "";
106
+ }
107
+ };
108
+ },
109
+ Image() {
110
+ },
111
+ Date() {
112
+ },
113
+ screen: {},
114
+ setTimeout() {
115
+ },
116
+ clearTimeout() {
117
+ },
118
+ matchMedia() {
119
+ return {};
120
+ },
121
+ requestAnimationFrame(e) {
122
+ return typeof setTimeout > "u" ? (e(), null) : setTimeout(e, 0);
123
+ },
124
+ cancelAnimationFrame(e) {
125
+ typeof setTimeout > "u" || clearTimeout(e);
126
+ }
127
+ };
128
+ function u() {
129
+ const e = typeof window < "u" ? window : {};
130
+ return p(e, T), e;
131
+ }
132
+ function v(e) {
133
+ return e === void 0 && (e = ""), e.trim().split(" ").filter((t) => !!t.trim());
134
+ }
135
+ function C(e) {
136
+ const t = e;
137
+ Object.keys(t).forEach((r) => {
138
+ try {
139
+ t[r] = null;
140
+ } catch {
141
+ }
142
+ try {
143
+ delete t[r];
144
+ } catch {
145
+ }
146
+ });
147
+ }
148
+ function P(e, t) {
149
+ return t === void 0 && (t = 0), setTimeout(e, t);
150
+ }
151
+ function A() {
152
+ return Date.now();
153
+ }
154
+ function b(e) {
155
+ const t = u();
156
+ let r;
157
+ return t.getComputedStyle && (r = t.getComputedStyle(e, null)), !r && e.currentStyle && (r = e.currentStyle), r || (r = e.style), r;
158
+ }
159
+ function L(e, t) {
160
+ t === void 0 && (t = "x");
161
+ const r = u();
162
+ let n, i, s;
163
+ const l = b(e);
164
+ return r.WebKitCSSMatrix ? (i = l.transform || l.webkitTransform, i.split(",").length > 6 && (i = i.split(", ").map((o) => o.replace(",", ".")).join(", ")), s = new r.WebKitCSSMatrix(i === "none" ? "" : i)) : (s = l.MozTransform || l.OTransform || l.MsTransform || l.msTransform || l.transform || l.getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,"), n = s.toString().split(",")), t === "x" && (r.WebKitCSSMatrix ? i = s.m41 : n.length === 16 ? i = parseFloat(n[12]) : i = parseFloat(n[4])), t === "y" && (r.WebKitCSSMatrix ? i = s.m42 : n.length === 16 ? i = parseFloat(n[13]) : i = parseFloat(n[5])), i || 0;
165
+ }
166
+ function m(e) {
167
+ return typeof e == "object" && e !== null && e.constructor && Object.prototype.toString.call(e).slice(8, -1) === "Object";
168
+ }
169
+ function M(e) {
170
+ return typeof window < "u" && typeof window.HTMLElement < "u" ? e instanceof HTMLElement : e && (e.nodeType === 1 || e.nodeType === 11);
171
+ }
172
+ function S() {
173
+ const e = Object(arguments.length <= 0 ? void 0 : arguments[0]), t = ["__proto__", "constructor", "prototype"];
174
+ for (let r = 1; r < arguments.length; r += 1) {
175
+ const n = r < 0 || arguments.length <= r ? void 0 : arguments[r];
176
+ if (n != null && !M(n)) {
177
+ const i = Object.keys(Object(n)).filter((s) => t.indexOf(s) < 0);
178
+ for (let s = 0, l = i.length; s < l; s += 1) {
179
+ const o = i[s], c = Object.getOwnPropertyDescriptor(n, o);
180
+ c !== void 0 && c.enumerable && (m(e[o]) && m(n[o]) ? n[o].__swiper__ ? e[o] = n[o] : S(e[o], n[o]) : !m(e[o]) && m(n[o]) ? (e[o] = {}, n[o].__swiper__ ? e[o] = n[o] : S(e[o], n[o])) : e[o] = n[o]);
181
+ }
182
+ }
183
+ }
184
+ return e;
185
+ }
186
+ function _(e, t, r) {
187
+ e.style.setProperty(t, r);
188
+ }
189
+ function j(e) {
190
+ let {
191
+ swiper: t,
192
+ targetPosition: r,
193
+ side: n
194
+ } = e;
195
+ const i = u(), s = -t.translate;
196
+ let l = null, o;
197
+ const c = t.params.speed;
198
+ t.wrapperEl.style.scrollSnapType = "none", i.cancelAnimationFrame(t.cssModeFrameID);
199
+ const h = r > s ? "next" : "prev", y = (f, d) => h === "next" && f >= d || h === "prev" && f <= d, g = () => {
200
+ o = (/* @__PURE__ */ new Date()).getTime(), l === null && (l = o);
201
+ const f = Math.max(Math.min((o - l) / c, 1), 0), d = 0.5 - Math.cos(f * Math.PI) / 2;
202
+ let a = s + d * (r - s);
203
+ if (y(a, r) && (a = r), t.wrapperEl.scrollTo({
204
+ [n]: a
205
+ }), y(a, r)) {
206
+ t.wrapperEl.style.overflow = "hidden", t.wrapperEl.style.scrollSnapType = "", setTimeout(() => {
207
+ t.wrapperEl.style.overflow = "", t.wrapperEl.scrollTo({
208
+ [n]: a
209
+ });
210
+ }), i.cancelAnimationFrame(t.cssModeFrameID);
211
+ return;
212
+ }
213
+ t.cssModeFrameID = i.requestAnimationFrame(g);
214
+ };
215
+ g();
216
+ }
217
+ function F(e, t) {
218
+ t === void 0 && (t = "");
219
+ const r = u(), n = [...e.children];
220
+ return r.HTMLSlotElement && e instanceof HTMLSlotElement && n.push(...e.assignedElements()), t ? n.filter((i) => i.matches(t)) : n;
221
+ }
222
+ function x(e, t) {
223
+ const r = [t];
224
+ for (; r.length > 0; ) {
225
+ const n = r.shift();
226
+ if (e === n)
227
+ return !0;
228
+ r.push(...n.children, ...n.shadowRoot ? n.shadowRoot.children : [], ...n.assignedElements ? n.assignedElements() : []);
229
+ }
230
+ }
231
+ function H(e, t) {
232
+ const r = u();
233
+ let n = t.contains(e);
234
+ return !n && r.HTMLSlotElement && t instanceof HTMLSlotElement && (n = [...t.assignedElements()].includes(e), n || (n = x(e, t))), n;
235
+ }
236
+ function I(e) {
237
+ try {
238
+ console.warn(e);
239
+ return;
240
+ } catch {
241
+ }
242
+ }
243
+ function D(e, t) {
244
+ t === void 0 && (t = []);
245
+ const r = document.createElement(e);
246
+ return r.classList.add(...Array.isArray(t) ? t : v(t)), r;
247
+ }
248
+ function W(e, t) {
249
+ const r = [];
250
+ for (; e.previousElementSibling; ) {
251
+ const n = e.previousElementSibling;
252
+ t ? n.matches(t) && r.push(n) : r.push(n), e = n;
253
+ }
254
+ return r;
255
+ }
256
+ function N(e, t) {
257
+ const r = [];
258
+ for (; e.nextElementSibling; ) {
259
+ const n = e.nextElementSibling;
260
+ t ? n.matches(t) && r.push(n) : r.push(n), e = n;
261
+ }
262
+ return r;
263
+ }
264
+ function q(e, t) {
265
+ return u().getComputedStyle(e, null).getPropertyValue(t);
266
+ }
267
+ function K(e) {
268
+ let t = e, r;
269
+ if (t) {
270
+ for (r = 0; (t = t.previousSibling) !== null; )
271
+ t.nodeType === 1 && (r += 1);
272
+ return r;
273
+ }
274
+ }
275
+ function V(e, t) {
276
+ const r = [];
277
+ let n = e.parentElement;
278
+ for (; n; )
279
+ t ? n.matches(t) && r.push(n) : r.push(n), n = n.parentElement;
280
+ return r;
281
+ }
282
+ function k(e, t, r) {
283
+ const n = u();
284
+ return e[t === "width" ? "offsetWidth" : "offsetHeight"] + parseFloat(n.getComputedStyle(e, null).getPropertyValue(t === "width" ? "margin-right" : "margin-top")) + parseFloat(n.getComputedStyle(e, null).getPropertyValue(t === "width" ? "margin-left" : "margin-bottom"));
285
+ }
286
+ function B(e) {
287
+ return (Array.isArray(e) ? e : [e]).filter((t) => !!t);
288
+ }
289
+ function R(e, t) {
290
+ t === void 0 && (t = ""), typeof trustedTypes < "u" ? e.innerHTML = trustedTypes.createPolicy("html", {
291
+ createHTML: (r) => r
292
+ }).createHTML(t) : e.innerHTML = t;
293
+ }
294
+ export {
295
+ F as a,
296
+ K as b,
297
+ D as c,
298
+ q as d,
299
+ S as e,
300
+ C as f,
301
+ O as g,
302
+ u as h,
303
+ j as i,
304
+ L as j,
305
+ N as k,
306
+ W as l,
307
+ _ as m,
308
+ P as n,
309
+ k as o,
310
+ H as p,
311
+ A as q,
312
+ V as r,
313
+ I as s,
314
+ B as t,
315
+ R as u
316
+ };
@@ -0,0 +1 @@
1
+ "use strict";function S(e){return e!==null&&typeof e=="object"&&"constructor"in e&&e.constructor===Object}function h(e,t){e===void 0&&(e={}),t===void 0&&(t={});const r=["__proto__","constructor","prototype"];Object.keys(t).filter(n=>r.indexOf(n)<0).forEach(n=>{typeof e[n]>"u"?e[n]=t[n]:S(t[n])&&S(e[n])&&Object.keys(t[n]).length>0&&h(e[n],t[n])})}const E={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function T(){const e=typeof document<"u"?document:{};return h(e,E),e}const v={document:E,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)}};function u(){const e=typeof window<"u"?window:{};return h(e,v),e}function x(e){return e===void 0&&(e=""),e.trim().split(" ").filter(t=>!!t.trim())}function M(e){const t=e;Object.keys(t).forEach(r=>{try{t[r]=null}catch{}try{delete t[r]}catch{}})}function b(e,t){return t===void 0&&(t=0),setTimeout(e,t)}function C(){return Date.now()}function O(e){const t=u();let r;return t.getComputedStyle&&(r=t.getComputedStyle(e,null)),!r&&e.currentStyle&&(r=e.currentStyle),r||(r=e.style),r}function P(e,t){t===void 0&&(t="x");const r=u();let n,i,l;const s=O(e);return r.WebKitCSSMatrix?(i=s.transform||s.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map(o=>o.replace(",",".")).join(", ")),l=new r.WebKitCSSMatrix(i==="none"?"":i)):(l=s.MozTransform||s.OTransform||s.MsTransform||s.msTransform||s.transform||s.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),n=l.toString().split(",")),t==="x"&&(r.WebKitCSSMatrix?i=l.m41:n.length===16?i=parseFloat(n[12]):i=parseFloat(n[4])),t==="y"&&(r.WebKitCSSMatrix?i=l.m42:n.length===16?i=parseFloat(n[13]):i=parseFloat(n[5])),i||0}function d(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"}function A(e){return typeof window<"u"&&typeof window.HTMLElement<"u"?e instanceof HTMLElement:e&&(e.nodeType===1||e.nodeType===11)}function p(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let r=1;r<arguments.length;r+=1){const n=r<0||arguments.length<=r?void 0:arguments[r];if(n!=null&&!A(n)){const i=Object.keys(Object(n)).filter(l=>t.indexOf(l)<0);for(let l=0,s=i.length;l<s;l+=1){const o=i[l],a=Object.getOwnPropertyDescriptor(n,o);a!==void 0&&a.enumerable&&(d(e[o])&&d(n[o])?n[o].__swiper__?e[o]=n[o]:p(e[o],n[o]):!d(e[o])&&d(n[o])?(e[o]={},n[o].__swiper__?e[o]=n[o]:p(e[o],n[o])):e[o]=n[o])}}}return e}function L(e,t,r){e.style.setProperty(t,r)}function _(e){let{swiper:t,targetPosition:r,side:n}=e;const i=u(),l=-t.translate;let s=null,o;const a=t.params.speed;t.wrapperEl.style.scrollSnapType="none",i.cancelAnimationFrame(t.cssModeFrameID);const y=r>l?"next":"prev",g=(f,m)=>y==="next"&&f>=m||y==="prev"&&f<=m,w=()=>{o=new Date().getTime(),s===null&&(s=o);const f=Math.max(Math.min((o-s)/a,1),0),m=.5-Math.cos(f*Math.PI)/2;let c=l+m*(r-l);if(g(c,r)&&(c=r),t.wrapperEl.scrollTo({[n]:c}),g(c,r)){t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout(()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[n]:c})}),i.cancelAnimationFrame(t.cssModeFrameID);return}t.cssModeFrameID=i.requestAnimationFrame(w)};w()}function F(e,t){t===void 0&&(t="");const r=u(),n=[...e.children];return r.HTMLSlotElement&&e instanceof HTMLSlotElement&&n.push(...e.assignedElements()),t?n.filter(i=>i.matches(t)):n}function I(e,t){const r=[t];for(;r.length>0;){const n=r.shift();if(e===n)return!0;r.push(...n.children,...n.shadowRoot?n.shadowRoot.children:[],...n.assignedElements?n.assignedElements():[])}}function j(e,t){const r=u();let n=t.contains(e);return!n&&r.HTMLSlotElement&&t instanceof HTMLSlotElement&&(n=[...t.assignedElements()].includes(e),n||(n=I(e,t))),n}function H(e){try{console.warn(e);return}catch{}}function D(e,t){t===void 0&&(t=[]);const r=document.createElement(e);return r.classList.add(...Array.isArray(t)?t:x(t)),r}function W(e,t){const r=[];for(;e.previousElementSibling;){const n=e.previousElementSibling;t?n.matches(t)&&r.push(n):r.push(n),e=n}return r}function N(e,t){const r=[];for(;e.nextElementSibling;){const n=e.nextElementSibling;t?n.matches(t)&&r.push(n):r.push(n),e=n}return r}function K(e,t){return u().getComputedStyle(e,null).getPropertyValue(t)}function V(e){let t=e,r;if(t){for(r=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(r+=1);return r}}function k(e,t){const r=[];let n=e.parentElement;for(;n;)t?n.matches(t)&&r.push(n):r.push(n),n=n.parentElement;return r}function q(e,t,r){const n=u();return e[t==="width"?"offsetWidth":"offsetHeight"]+parseFloat(n.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-right":"margin-top"))+parseFloat(n.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-left":"margin-bottom"))}function B(e){return(Array.isArray(e)?e:[e]).filter(t=>!!t)}function R(e,t){t===void 0&&(t=""),typeof trustedTypes<"u"?e.innerHTML=trustedTypes.createPolicy("html",{createHTML:r=>r}).createHTML(t):e.innerHTML=t}exports.animateCSSModeScroll=_;exports.createElement=D;exports.deleteProps=M;exports.elementChildren=F;exports.elementIndex=V;exports.elementIsChildOf=j;exports.elementNextAll=N;exports.elementOuterSize=q;exports.elementParents=k;exports.elementPrevAll=W;exports.elementStyle=K;exports.extend=p;exports.getDocument=T;exports.getTranslate=P;exports.getWindow=u;exports.makeElementsArray=B;exports.nextTick=b;exports.now=C;exports.setCSSProperty=L;exports.setInnerHTML=R;exports.showWarning=H;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "officialblock",
3
3
  "private": false,
4
- "version": "1.0.6",
4
+ "version": "1.0.8",
5
5
  "description": "A Vue 3 article list component library",
6
6
  "author": "Your Name",
7
7
  "license": "MIT",
@@ -64,6 +64,7 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@wangeditor/editor-for-vue": "^5.1.12",
67
+ "swiper": "^11.2.10",
67
68
  "vue-router": "^4.5.1",
68
69
  "vuedraggable": "^4.1.0"
69
70
  }
@@ -46,7 +46,7 @@ defineProps({
46
46
  margin-top: 16px;
47
47
  }
48
48
 
49
- @media(max-width: 767.98px) {
49
+ @media (max-width: 767.98px) {
50
50
  .article-item-title {
51
51
  font-size: 24px;
52
52
  font-weight: 500;
@@ -54,7 +54,7 @@ defineProps({
54
54
  }
55
55
 
56
56
  .article-item-button {
57
- flex-direction:column;
57
+ flex-direction: column;
58
58
  align-items: flex-start;
59
59
  }
60
60
 
@@ -63,7 +63,7 @@ defineProps({
63
63
  }
64
64
  }
65
65
 
66
- @media(max-width: 767.98px)and (max-width:767.98px) {
66
+ @media (max-width: 767.98px) and (max-width: 767.98px) {
67
67
  .article-item-title {
68
68
  font-size: 20px;
69
69
  line-height: 1.2;
@@ -22,7 +22,7 @@ defineProps({
22
22
  })
23
23
  </script>
24
24
 
25
- <style lang="scss" scoped>
25
+ <style lang="scss" scoped>
26
26
  @use '../../styles/editor.scss' as *;
27
27
  .contact-item {
28
28
  max-width: 952px;
@@ -57,37 +57,37 @@ defineProps({
57
57
  </style>
58
58
 
59
59
  <style lang="scss">
60
- @media(max-width: 1023.98px) {
60
+ @media (max-width: 1023.98px) {
61
61
  .contact-item {
62
62
  max-width: 1000px;
63
- padding-left:24px;
63
+ padding-left: 24px;
64
64
  padding-right: 24px;
65
65
  }
66
66
  }
67
67
 
68
- @media(max-width: 767.98px) {
68
+ @media (max-width: 767.98px) {
69
69
  .contact-item {
70
- padding-left:12px;
70
+ padding-left: 12px;
71
71
  padding-right: 12px;
72
72
  }
73
73
 
74
74
  .contact-item-title {
75
- font-size:24px;
75
+ font-size: 24px;
76
76
  font-weight: 500;
77
77
  line-height: 1.5;
78
78
  margin-top: 12px;
79
79
  }
80
80
  }
81
81
 
82
- @media(max-width: 575.98px) {
82
+ @media (max-width: 575.98px) {
83
83
  .contact-item {
84
- padding-left:12px;
84
+ padding-left: 12px;
85
85
  padding-right: 12px;
86
86
  max-width: 976px;
87
87
  }
88
88
 
89
89
  .contact-item-title {
90
- font-size:20px;
90
+ font-size: 20px;
91
91
  line-height: 1.2;
92
92
  letter-spacing: -.005em;
93
93
  }
@@ -8,4 +8,4 @@ export default {
8
8
  } satisfies Plugin
9
9
 
10
10
  export { default as ArticleList } from './index.vue'
11
- export type { ComponentProps, ComponentEmits, ComponentSlots } from './type'
11
+ export type { ArticleListProps, ArticleListEmits } from './type'
@@ -1,28 +1,23 @@
1
1
  <template>
2
- <div class="article-list-container" :style="{ background: modelValue?.background ? modelValue?.background === 'white' ? '#fff' : '#F7F7FA' : 'transparent' }">
3
- <a-row class="article-list" @mouseenter="isHover = true" @mouseleave="isHover = false">
2
+ <div class="article-list-container" :style="{ backgroundColor: modelValue?.bgColor }" @mouseenter="isHover = true" @mouseleave="isHover = false">
3
+ <a-row class="article-list" :class="[modelValue?.width ? `container-content-${modelValue?.width}` : 'container-content']">
4
4
  <!-- 左侧文本 后侧媒体 -->
5
5
  <!-- 左侧一直是一半,但只有左侧时是100% -->
6
6
  <a-col :sm="{span: 24}" :md="{span: hasMedia ? 12 : 24}">
7
7
  <div class="article-list-left">
8
8
  <template v-for="item in modelValue?.data" :key="item.id">
9
- <Article v-if="item.type === 'Article'" :article="item.data"></Article>
10
- <Contact v-if="item.type === 'Contact'" :contact="item.data"></Contact>
9
+ <Article v-if="item.type === 'Article'" :article="item"></Article>
10
+ <Contact v-if="item.type === 'Contact'" :contact="item"></Contact>
11
11
  </template>
12
12
  </div>
13
13
  </a-col>
14
14
  <a-col v-if="hasMedia" :sm="{span: 24}" :md="{span: 12}">
15
15
  <div class="article-list-right">
16
16
  <template v-for="item in modelValue?.data" :key="item.id">
17
- <Media :type="item.type" :data="item.data" :preview="modelValue.isPreview"></Media>
17
+ <Media :type="item.type" :data="item" :preview="modelValue.isPreview"></Media>
18
18
  </template>
19
19
  </div>
20
20
  </a-col>
21
-
22
- <!-- <div v-if="isHover" class="add-btn">
23
- <icon-plus />
24
- <span class="btn-text">添加组件</span>
25
- </div> -->
26
21
  <Operate v-if="!modelValue?.readOnly" v-model:show="isHover" @handle-edit="showSetting = true" @handle-delete="handleDelete" @handle-copy="handleCopy"></Operate>
27
22
  </a-row>
28
23
  </div>
@@ -66,83 +61,37 @@ const hasMedia = computed(() => {
66
61
  })
67
62
 
68
63
  const handleInit = () => {
69
- if (props.modelValue && props.modelValue.datad) return // 有数据不用初始化
64
+ if (props.modelValue && props.modelValue.data) return // 有数据不用初始化
70
65
  const data = {
71
- id: randomString(),
66
+ id: props.modelValue?.id || randomString(),
72
67
  type: 'ArticleList',
73
68
  readOnly: props.modelValue?.readOnly || false,
74
69
  width: '',
75
- background: '',
70
+ bgColor: '',
76
71
  data: [
77
72
  {
78
73
  id: randomString(),
79
74
  type: 'Article',
80
- data: {
81
- title: '耀华国际教育学校浙江桐乡',
82
- content: '耀华国际教育学校浙江桐乡校区成立于 2017 年,先进的校园设施确保学 生在安全友好的环境中学习。学校坐落于高桥镇,提供从幼儿阶段至高中 阶段 (K2 至13 年级) 的教育服务,招收2 岁至18 岁本地和外籍学生。',
83
- buttonList: [],
84
- linkList: [
85
- {
86
- id: randomString(),
87
- text: '了解更多',
88
- url: 'https://www.baidu.com',
89
- isExternal: false
90
- }
91
- ]
92
- }
75
+ title: '耀华国际教育学校浙江桐乡',
76
+ content: '耀华国际教育学校浙江桐乡校区成立于 2017 年,先进的校园设施确保学 生在安全友好的环境中学习。学校坐落于高桥镇,提供从幼儿阶段至高中 阶段 (K2 至13 年级) 的教育服务,招收2 岁至18 岁本地和外籍学生。',
77
+ buttonList: [],
78
+ linkList: [
79
+ {
80
+ id: randomString(),
81
+ text: '了解更多',
82
+ url: 'https://www.baidu.com',
83
+ isExternal: false
84
+ }
85
+ ]
93
86
  },
94
87
  {
95
88
  id: randomString(),
96
89
  type: 'Image',
97
- data: {
98
- imgSrc: 'https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg',
99
- caption: '',
100
- alt: '',
101
- isRound: false
102
- }
90
+ imgSrc: 'https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg',
91
+ caption: '',
92
+ alt: '',
93
+ isRound: false
103
94
  },
104
- // {
105
- // id: randomString(),
106
- // type: 'Contact',
107
- // data: {
108
- // title: '这里是标题',
109
- // content: '耀华国际教育学校浙江桐乡校区成立于 2017 年,先进的校园设施确保学 生在安全友好的环境中学习。学校坐落于高桥镇,提供从幼儿阶段至高中 阶段 (K2 至13 年级) 的教育服务,招收2 岁至18 岁本地和外籍学生。',
110
- // categories: [
111
- // {
112
- // id: randomString(),
113
- // text: '分类1'
114
- // }
115
- // ],
116
- // linkList: [
117
- // {
118
- // id: randomString(),
119
- // text: '查看更多',
120
- // url: 'https://www.baidu.com',
121
- // isExternal: false
122
- // }
123
- // ]
124
- // }
125
- // },
126
- // {
127
- // id: randomString(),
128
- // type: 'ImageList',
129
- // data: {
130
- // imageList: [
131
- // {
132
- // id: randomString(),
133
- // src: 'https://osswebsite.ycyw.com/media-library/ywies-bj/images/home/ywies-tx.jpg'
134
- // }
135
- // ],
136
- // }
137
- // },
138
- // {
139
- // id: randomString(),
140
- // type: 'Video',
141
- // data: {
142
- // videoSrc: 'http://mpv.videocc.net/4b964bbdf4/3/4b964bbdf481505df84cfd703c4b3043_2.mp4',
143
- // imgSrc: 'https://object.ycyw.com/media-library/ycyw-edu/news/20250628%20HKDSE%20Forum/Cover.jpg',
144
- // }
145
- // },
146
95
  ]
147
96
  }
148
97
  emit('update:modelValue', data)
@@ -172,13 +121,6 @@ handleInit()
172
121
  }
173
122
  .article-list {
174
123
  position: relative;
175
- max-width: 952px;
176
- padding: 16px 36px;
177
- margin: 0 auto;
178
-
179
- // &:hover {
180
- // border: 2px solid $primary-color;
181
- // }
182
124
 
183
125
  .add-btn {
184
126
  position: absolute;
@@ -232,7 +174,7 @@ handleInit()
232
174
  /* 小手机 (575px 及以下) */
233
175
  @media (max-width: 575.98px) {
234
176
  .article-list {
235
- padding: 8px 12px;
177
+ padding: 8px 12px;
236
178
  max-width: 100%;
237
179
  }
238
180