@shijiu/jsview-vue-samples 2.0.1021 → 2.0.1073

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 (93) hide show
  1. package/Basic/components/div/DivBackground.vue +1 -1
  2. package/Basic/components/div/DivCssVar.vue +34 -16
  3. package/CommonUtils/ResourceData.js +11 -0
  4. package/CommonUtils/getSearchQuery.js +44 -0
  5. package/CssPreprocessor/Less/App.vue +1 -1
  6. package/CssPreprocessor/Less/components/less-group1/LessComments.vue +2 -2
  7. package/CssPreprocessor/Less/components/less-group1/LessConditionals.vue +2 -2
  8. package/CssPreprocessor/Less/components/less-group1/LessVariables.vue +6 -6
  9. package/CssPreprocessor/Less/components/less-group2/LessIteration.vue +1 -1
  10. package/CssPreprocessor/Less/components/less-group2/LessMethods.vue +2 -2
  11. package/CssPreprocessor/Less/components/less-group3/LessExtends.vue +2 -2
  12. package/CssPreprocessor/Less/components/less-group3/LessNesting.vue +4 -4
  13. package/CssPreprocessor/Less/components/less-group4/LessKeyframes.vue +1 -1
  14. package/CssPreprocessor/Less/components/less-group4/LessMaps.vue +1 -1
  15. package/CssPreprocessor/Less/components/less-group4/LessMixins.vue +1 -1
  16. package/CssPreprocessor/Less/components/less-group5/LessImporting.vue +7 -3
  17. package/CssPreprocessor/Less/components/less-group5/TextSettings.less +8 -1
  18. package/CssPreprocessor/Scss/App.vue +1 -1
  19. package/CssPreprocessor/Scss/components/scss-group1/ScssComments.vue +11 -10
  20. package/CssPreprocessor/Scss/components/scss-group1/ScssConditionals.vue +8 -6
  21. package/CssPreprocessor/Scss/components/scss-group1/ScssOperations.vue +2 -2
  22. package/CssPreprocessor/Scss/components/scss-group1/ScssVariables.vue +6 -6
  23. package/CssPreprocessor/Scss/components/scss-group2/ScssIteration.vue +2 -2
  24. package/CssPreprocessor/Scss/components/scss-group2/ScssMethods.vue +9 -9
  25. package/CssPreprocessor/Scss/components/scss-group3/ScssExtends.vue +2 -2
  26. package/CssPreprocessor/Scss/components/scss-group3/ScssNesting.vue +3 -3
  27. package/CssPreprocessor/Scss/components/scss-group4/ScssKeyframes.vue +1 -1
  28. package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +1 -1
  29. package/CssPreprocessor/Scss/components/scss-group4/ScssMixins.vue +1 -1
  30. package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +7 -3
  31. package/CssPreprocessor/Scss/components/scss-group5/TextSettings.scss +8 -1
  32. package/CssPreprocessor/Stylus/App.vue +1 -1
  33. package/CssPreprocessor/Stylus/components/stylus-group1/StylusComments.vue +2 -2
  34. package/CssPreprocessor/Stylus/components/stylus-group1/StylusConditionals.vue +2 -2
  35. package/CssPreprocessor/Stylus/components/stylus-group1/StylusVariables.vue +7 -7
  36. package/CssPreprocessor/Stylus/components/stylus-group2/StylusIteration.vue +1 -1
  37. package/CssPreprocessor/Stylus/components/stylus-group2/StylusMethods.vue +3 -3
  38. package/CssPreprocessor/Stylus/components/stylus-group3/StylusExtends.vue +2 -2
  39. package/CssPreprocessor/Stylus/components/stylus-group3/StylusNesting.vue +5 -5
  40. package/CssPreprocessor/Stylus/components/stylus-group4/StylusKeyframes.vue +1 -1
  41. package/CssPreprocessor/Stylus/components/stylus-group4/StylusMaps.vue +1 -1
  42. package/CssPreprocessor/Stylus/components/stylus-group4/StylusMixins.vue +1 -1
  43. package/CssPreprocessor/Stylus/components/stylus-group5/StylusImporting.vue +7 -3
  44. package/CssPreprocessor/Stylus/components/stylus-group5/TextSettings.styl +8 -1
  45. package/CssPreprocessor/utils/ContentBlock.vue +5 -3
  46. package/CssPreprocessor/utils/FontStyle.css +1 -1
  47. package/CssPreprocessor/utils/Panel.vue +1 -1
  48. package/CssPreprocessor/utils/TitleBar.vue +4 -2
  49. package/DemoHomepage/App.vue +22 -19
  50. package/DemoHomepage/router.js +9 -0
  51. package/FilterDemo/AnimatePic.vue +6 -1
  52. package/FocusMoveStyle/App.vue +37 -46
  53. package/FocusMoveStyle/Item.vue +7 -17
  54. package/FocusMoveStyle/assets/redCircle.png +0 -0
  55. package/GiftRain/App.vue +52 -27
  56. package/GiftRain/components/RedPacket.vue +17 -15
  57. package/JsvRadarChart/App.vue +99 -0
  58. package/JsvRadarChart/assets/Square.png +0 -0
  59. package/JsvRadarChart/assets/resultSquare.png +0 -0
  60. package/MetroWidgetDemos/SkeletonDiagram/App.vue +78 -0
  61. package/MetroWidgetDemos/SkeletonDiagram/Item.vue +111 -0
  62. package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.json +237 -0
  63. package/MetroWidgetDemos/SkeletonDiagram/data.js +16 -0
  64. package/MetroWidgetDemos/itemSizeUpdate/App.vue +51 -0
  65. package/MetroWidgetDemos/itemSizeUpdate/backward/Backward.vue +107 -0
  66. package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +133 -0
  67. package/MetroWidgetDemos/itemSizeUpdate/center/Center.vue +106 -0
  68. package/MetroWidgetDemos/itemSizeUpdate/center/Item.vue +118 -0
  69. package/MetroWidgetDemos/ninePatchFocusPage/App.vue +105 -0
  70. package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +69 -0
  71. package/MetroWidgetDemos/ninePatchFocusPage/PageRow.vue +89 -0
  72. package/MetroWidgetDemos/routeList.js +18 -5
  73. package/MetroWidgetDemos/slideSetting/App.vue +8 -8
  74. package/MockjsDemo/App.vue +54 -0
  75. package/MockjsDemo/KeyEventCatcher.vue +19 -0
  76. package/MockjsDemo/mock/index.js +12 -0
  77. package/NinePatchDemo/App.vue +2 -2
  78. package/NinePatchDemo/Item.vue +15 -5
  79. package/Preload/Item.vue +27 -10
  80. package/SprayView/App.vue +71 -63
  81. package/SprayView/assets/goldencoin1.png +0 -0
  82. package/SprayView/assets/goldencoin2.png +0 -0
  83. package/SprayView/assets/redpacket1.png +0 -0
  84. package/SprayView/assets/redpacket2.png +0 -0
  85. package/SprayView/assets/star1.png +0 -0
  86. package/SprayView/assets/star2.png +0 -0
  87. package/SprayView/assets/star3.png +0 -0
  88. package/SprayView/assets/star4.png +0 -0
  89. package/Swiper/App.vue +1 -1
  90. package/TextureAnimation/App2.vue +4 -2
  91. package/TouchSample/Item.vue +0 -1
  92. package/package.json +2 -1
  93. /package/{FocusMoveStyle/assets/focus.png → assets/focus1.png} +0 -0
@@ -1,18 +1,17 @@
1
1
  <script setup>
2
- import { ref, inject } from "vue";
2
+ import { shallowRef, inject } from "vue";
3
+ import imgSrc from "../assets/jpegDemo.jpeg";
3
4
 
4
5
  const focusSize = inject("focusSize");
5
6
 
6
7
  const props = defineProps({
7
8
  data: Object,
8
9
  query: Object,
9
- onEdge: Function,
10
10
  onAction: Object,
11
- frameChanged: Function,
12
11
  });
13
12
 
14
- const focused = ref(false);
15
- const divRef = ref(null);
13
+ const focused = shallowRef(false);
14
+ const divRef = shallowRef(null);
16
15
 
17
16
  const onFocus = () => {
18
17
  focused.value = true;
@@ -46,6 +45,7 @@ props.onAction.register("onClick", onClicked);
46
45
 
47
46
  <template>
48
47
  <div
48
+ v-if="query.index == 1"
49
49
  ref="divRef"
50
50
  :class="focused ? 'focus' : 'blur'"
51
51
  :style="{
@@ -57,6 +57,16 @@ props.onAction.register("onClick", onClicked);
57
57
  >
58
58
  {{ data.content }}
59
59
  </div>
60
+ <img
61
+ v-else
62
+ ref="divRef"
63
+ :class="focused ? 'focus' : 'blur'"
64
+ :src="`url(${imgSrc})`"
65
+ :style="{
66
+ width: data.width,
67
+ height: data.height,
68
+ }"
69
+ />
60
70
  </template>
61
71
 
62
72
  <style scoped>
package/Preload/Item.vue CHANGED
@@ -1,12 +1,12 @@
1
1
  <script setup>
2
- import { ref } from "vue";
2
+ import { shallowRef, watch } from "vue";
3
3
  const props = defineProps({
4
4
  data: Object,
5
5
  query: Object,
6
6
  onEdge: Function,
7
7
  onAction: Object,
8
8
  });
9
- const focus = ref(false);
9
+ const focus = shallowRef(false);
10
10
 
11
11
  const onFocus = () => {
12
12
  focus.value = true;
@@ -19,14 +19,31 @@ props.onAction.register("onBlur", onBlur);
19
19
  props.onAction.register("onClick", () => {
20
20
  console.log("cchtest item on click ", data);
21
21
  });
22
+
23
+ const imgUrl = shallowRef(props.data.url);
24
+
25
+ watch(focus, () => {
26
+ imgUrl.value = focus.value ? props.data.focusUrl : props.data.url;
27
+ });
22
28
  </script>
23
29
 
24
30
  <template>
25
- <div
26
- :style="{
27
- width: 166,
28
- height: 90,
29
- backgroundImage: focus ? data.focusUrl : data.url,
30
- }"
31
- ></div>
32
- </template>
31
+ <div>
32
+ <!-- 测试div的backgroundImage响应式处理 -->
33
+ <!-- <div
34
+ :style="{
35
+ width: 166,
36
+ height: 90,
37
+ backgroundImage: imgUrl,
38
+ }"
39
+ ></div> -->
40
+ <!-- 测试img的src响应式处理 -->
41
+ <img
42
+ :src="imgUrl"
43
+ :style="{
44
+ width: 166,
45
+ height: 90,
46
+ }"
47
+ />
48
+ </div>
49
+ </template>
package/SprayView/App.vue CHANGED
@@ -9,9 +9,19 @@
9
9
  import { JsvSpray } from "jsview";
10
10
  import { ref } from "vue";
11
11
  import snow from "./assets/snow.png";
12
+ import GoldenCoin1 from "./assets/goldencoin1.png";
13
+ import GoldenCoin2 from "./assets/goldencoin2.png";
14
+ import RedPacket1 from "./assets/redpacket1.png";
15
+ import RedPacket2 from "./assets/redpacket2.png";
16
+ import Star1 from "./assets/star1.png";
17
+ import Star2 from "./assets/star2.png";
18
+ import Star3 from "./assets/star3.png";
19
+ import Star4 from "./assets/star4.png";
20
+ //定义图片url列表
21
+ const ImgData = [snow, GoldenCoin1, GoldenCoin2, RedPacket1, RedPacket2, Star1, Star2, Star3, Star4]
12
22
  const sprayOk = {
13
23
  type: 0,
14
- particleNum: 100,
24
+ particleNum: 50,
15
25
  deltaAngle: 180,
16
26
  deltaWidth: 50,
17
27
  deltaHeight: 50,
@@ -30,7 +40,7 @@ const sprayOk = {
30
40
 
31
41
  const sprayRotate = {
32
42
  type: 1,
33
- particleNum: 100,
43
+ particleNum: 50,
34
44
  deltaAngle: 0,
35
45
  deltaWidth: 0,
36
46
  deltaHeight: 50,
@@ -134,33 +144,26 @@ const s = {
134
144
 
135
145
  <template>
136
146
  <div class="root">
137
- <jsv-focus-block
138
- autoFocus
139
- :onAction="{
140
- onKeyDown: onKeyDown,
141
- }"
142
- >
147
+ <jsv-focus-block autoFocus :onAction="{
148
+ onKeyDown: onKeyDown,
149
+ }">
143
150
  <div :style="{ top: 20, left: 400 }">
144
- <div
145
- :style="{
146
- width: 40,
147
- height: 40,
148
- animation: 'cycle 3s linear infinite',
149
- }"
150
- >
151
+ <div :style="{
152
+ width: 40,
153
+ height: 40,
154
+ animation: 'cycle 3s linear infinite',
155
+ }">
151
156
  <jsv-spray :pointRes="`url(${snow})`" :sprayStyle="sprayCycle" />
152
157
  </div>
153
- <div
154
- :style="{
155
- top: 20,
156
- width: 400,
157
- height: 100,
158
- lineHeight: 100,
159
- textAlign: 'center',
160
- fontSize: 50,
161
- color: '#FFFFFF',
162
- }"
163
- >
158
+ <div :style="{
159
+ top: 20,
160
+ width: 400,
161
+ height: 100,
162
+ lineHeight: 100,
163
+ textAlign: 'center',
164
+ fontSize: 50,
165
+ color: '#FFFFFF',
166
+ }">
164
167
  粒子效果
165
168
  </div>
166
169
  <div class="describe">
@@ -168,24 +171,22 @@ const s = {
168
171
  </div>
169
172
  </div>
170
173
 
171
- <div
172
- :style="{
173
- left: 0,
174
- top: 200,
175
- width: 400,
176
- height: 600,
177
- overflow: 'hidden',
178
- }"
179
- >
174
+ <div :style="{
175
+ left: 0,
176
+ top: 200,
177
+ width: 400,
178
+ height: 600,
179
+ overflow: 'hidden',
180
+ }">
180
181
  <div :style="{ top: 150, left: 150 }">
181
182
  <div class="spray-ok">
182
- <jsv-spray
183
- v-if="okCount > 0"
184
- :key="okCount"
185
- :pointRes="`url(${snow})`"
183
+ <div v-if="okCount > 0">
184
+ <jsv-spray v-for="item in ImgData"
185
+ :key="okCount"
186
+ :pointRes="`url(${item})`"
186
187
  :sprayStyle="sprayOk"
187
- :ignoreClip="true"
188
- />
188
+ :ignoreClip="true" />
189
+ </div>
189
190
  </div>
190
191
  <div class="describe">
191
192
  {{
@@ -194,36 +195,29 @@ const s = {
194
195
  </div>
195
196
  </div>
196
197
  </div>
197
- <div
198
- :style="{
199
- left: 400,
200
- top: 200,
201
- width: 400,
202
- height: 600,
203
- overflow: 'hidden',
204
- }"
205
- >
198
+ <div :style="{
199
+ left: 400,
200
+ top: 200,
201
+ width: 400,
202
+ height: 600,
203
+ overflow: 'hidden',
204
+ }">
206
205
  <div :style="{ top: 150, left: 195 }">
207
206
  <div class="spray-rotate">
208
- <jsv-spray
209
- pointRes="rgba(0, 255, 0, 1)"
210
- :sprayStyle="sprayRotate"
211
- />
207
+ <jsv-spray v-for="item in ImgData" :pointRes="`url(${item})`" :sprayStyle="sprayRotate" />
212
208
  </div>
213
209
  <div class="describe">
214
210
  {{ `#粒子沿长边随机生成\n#初速度沿长边方向\n#受竖直方向的力作用` }}
215
211
  </div>
216
212
  </div>
217
213
  </div>
218
- <div
219
- :style="{
220
- left: 800,
221
- top: 200,
222
- width: 400,
223
- height: 600,
224
- overflow: 'hidden',
225
- }"
226
- >
214
+ <div :style="{
215
+ left: 800,
216
+ top: 200,
217
+ width: 400,
218
+ height: 600,
219
+ overflow: 'hidden',
220
+ }">
227
221
  <div :style="{ top: 150, left: 150 }">
228
222
  <div class="spray-move">
229
223
  <jsv-spray :pointRes="`url(${snow})`" :sprayStyle="sprayMove" />
@@ -244,15 +238,19 @@ const s = {
244
238
  0% {
245
239
  transform: translate3d(0, 0, 0);
246
240
  }
241
+
247
242
  25% {
248
243
  transform: translate3d(100, 0, 0);
249
244
  }
245
+
250
246
  50% {
251
247
  transform: translate3d(0, 0, 0);
252
248
  }
249
+
253
250
  75% {
254
251
  transform: translate3d(100, 0, 0);
255
252
  }
253
+
256
254
  100% {
257
255
  transform: translate3d(0, 0, 0);
258
256
  }
@@ -262,6 +260,7 @@ const s = {
262
260
  from {
263
261
  transform: rotate3d(0, 0, 1, 0);
264
262
  }
263
+
265
264
  to {
266
265
  transform: rotate3d(0, 0, 1, 360deg);
267
266
  }
@@ -271,19 +270,24 @@ const s = {
271
270
  0% {
272
271
  transform: translate3d(0, 0, 0);
273
272
  }
273
+
274
274
  40% {
275
275
  transform: translate3d(400, 0, 0);
276
276
  }
277
+
277
278
  50% {
278
279
  transform: translate3d(400, 100, 0);
279
280
  }
281
+
280
282
  90% {
281
283
  transform: translate3d(0, 100, 0);
282
284
  }
285
+
283
286
  100% {
284
287
  transform: translate3d(0, 0, 0);
285
288
  }
286
289
  }
290
+
287
291
  .root {
288
292
  width: 1280;
289
293
  height: 720;
@@ -295,23 +299,27 @@ const s = {
295
299
  height: 100;
296
300
  background-color: #00ff00;
297
301
  }
302
+
298
303
  .spray-rotate {
299
304
  width: 10;
300
305
  height: 100;
301
306
  background-color: #00ff00;
302
307
  animation: rotate 3s linear infinite;
303
308
  }
309
+
304
310
  .spray-move {
305
311
  width: 100;
306
312
  height: 100;
307
313
  background-color: #00ff00;
308
314
  animation: move-back-force 10s linear infinite;
309
315
  }
316
+
310
317
  .spray-cycle {
311
318
  width: 40;
312
319
  height: 40;
313
320
  animation: cycle 3s linear infinite;
314
321
  }
322
+
315
323
  .describe {
316
324
  left: 0;
317
325
  top: 140;
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/Swiper/App.vue CHANGED
@@ -140,7 +140,7 @@ onMounted(() => {
140
140
  dataIndex == currentIndex
141
141
  ? 'rgba(100, 100, 100, 0.7)'
142
142
  : '#ff0000',
143
- borderRadius: '15px',
143
+ borderRadius: 10,
144
144
  }"
145
145
  ></div>
146
146
  </template>
@@ -12,6 +12,9 @@ import {
12
12
  import img from "./assets/light.png";
13
13
  import img2 from "./assets/light2.png";
14
14
  import mask from "./assets/mask.png";
15
+ import { getDataUrl } from "../CommonUtils/ResourceData";
16
+ //无网络环境下使用
17
+ const DemoResourceBase = getDataUrl()
15
18
 
16
19
  const getRandom = (start, end) => {
17
20
  return Math.round(Math.random() * (end - start) + start);
@@ -58,8 +61,7 @@ const onKeyDown = (ev) => {
58
61
  :style="{
59
62
  width: 1280,
60
63
  height: 720,
61
- backgroundImage:
62
- 'https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg',
64
+ backgroundImage: DemoResourceBase ?`${DemoResourceBase}/BackgroundLongmao.jpg` :'https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg',
63
65
  }"
64
66
  >
65
67
  <div
@@ -6,7 +6,6 @@
6
6
  * @Description: file content
7
7
  -->
8
8
  <script>
9
- import { getPositionRelativeToView } from "jsview";
10
9
  function randomColor() {
11
10
  let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
12
11
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shijiu/jsview-vue-samples",
3
- "version": "2.0.1021",
3
+ "version": "2.0.1073",
4
4
  "license": "MIT",
5
5
  "repository": "system/jsview-framework",
6
6
  "author": "mengxk",
@@ -13,6 +13,7 @@
13
13
  ],
14
14
  "devDependencies": {
15
15
  "less": "4.1.3",
16
+ "mockjs": "1.1.0",
16
17
  "sass": "1.58.1",
17
18
  "stylus": "0.59.0"
18
19
  },