@shijiu/jsview-vue-samples 2.1.25 → 2.1.200

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 (62) hide show
  1. package/Basic/components/div/DivBackground.vue +53 -24
  2. package/BreakRender/App.vue +69 -0
  3. package/BreakRender/Item.vue +77 -0
  4. package/BreakRender/assets/imageList.json +237 -0
  5. package/BreakRender/data.js +18 -0
  6. package/ClassDynamicSwitching/App.vue +83 -0
  7. package/ClassDynamicSwitching/components/ClassItem.vue +257 -0
  8. package/ClassDynamicSwitching/components/ClassShow.vue +78 -0
  9. package/ClassDynamicSwitching/components/StyleItem.vue +165 -0
  10. package/ClassDynamicSwitching/components/StyleShow.vue +68 -0
  11. package/DemoHomepage/router.js +67 -13
  12. package/DemoHomepage/views/Homepage.vue +13 -2
  13. package/DynamicClass/App.vue +115 -0
  14. package/DynamicClass/components/FloorItem.vue +55 -0
  15. package/DynamicClass/components/FloorList.vue +210 -0
  16. package/DynamicClass/style1.json +163 -0
  17. package/DynamicClass/style2.json +164 -0
  18. package/FilterDemo/App.vue +1 -1
  19. package/FocusMoveStyle/App.vue +10 -2
  20. package/FreeMove/App.vue +291 -0
  21. package/GetBoundingClientRect/App.vue +177 -0
  22. package/GiftRain/App.vue +3 -3
  23. package/JsvLine/App.vue +116 -0
  24. package/JsvLine/bgimage.jpg +0 -0
  25. package/JsvPreDownloader/App.vue +17 -10
  26. package/LatexDemo/App.vue +66 -0
  27. package/LatexFormula/App.vue +65 -0
  28. package/Marquee/App.vue +711 -183
  29. package/MetroWidgetDemos/PingPong/App.vue +0 -9
  30. package/MetroWidgetDemos/PingPong/AppPage.vue +2 -1
  31. package/MetroWidgetDemos/PingPong/WidgetItem.vue +0 -5
  32. package/MetroWidgetDemos/SkeletonDiagram/App.vue +3 -1
  33. package/MetroWidgetDemos/SkeletonDiagram/Item.vue +5 -0
  34. package/MetroWidgetDemos/itemSizeUpdate/App.vue +11 -4
  35. package/MetroWidgetDemos/itemSizeUpdate/backward/Backward.vue +6 -4
  36. package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +2 -25
  37. package/MetroWidgetDemos/itemSizeUpdate/center/Center.vue +6 -6
  38. package/MetroWidgetDemos/itemSizeUpdate/center/Item.vue +38 -49
  39. package/MetroWidgetDemos/itemSizeUpdate/stretch/App.vue +122 -0
  40. package/MetroWidgetDemos/itemSizeUpdate/stretch/Item.vue +105 -0
  41. package/MindMap/App.vue +61 -0
  42. package/MindMap/Item.vue +40 -0
  43. package/MindMap/data.js +86 -0
  44. package/Preload/App.vue +25 -18
  45. package/Preload/Item.vue +1 -1
  46. package/Preload/data.js +12 -12
  47. package/Preload/images/bg_btn.png +0 -0
  48. package/Preload/images/bg_btn_focus.png +0 -0
  49. package/Preload/images/btn_cancle.png +0 -0
  50. package/Preload/images/btn_ok.png +0 -0
  51. package/Preload/images/tease.png +0 -0
  52. package/Preload/images/tease_lock.png +0 -0
  53. package/SecTorTest/App.vue +106 -0
  54. package/TextureStoreTest/App.vue +168 -0
  55. package/VisibleSensorDemo/App.vue +38 -18
  56. package/package.json +1 -1
  57. package/Preload/images/rank.png +0 -0
  58. package/Preload/images/rank_focus.png +0 -0
  59. package/Preload/images/rule.png +0 -0
  60. package/Preload/images/rule_focus.png +0 -0
  61. package/Preload/images/start.png +0 -0
  62. package/Preload/images/start_focus.png +0 -0
@@ -0,0 +1,257 @@
1
+ <template>
2
+ <div :class="['poster', posterChange]">
3
+ <div class="titleShow">{{ props.data.title }}</div>
4
+ <div class="item item1">
5
+ <div class="littleItem littleItem1"></div>
6
+ <div class="littleItem littleItem2"></div>
7
+ <div class="littleItem littleItem3"></div>
8
+ <div class="littleItem littleItem4"></div>
9
+ <div class="littleItem littleItem5"></div>
10
+ <div class="littleItem littleItem6"></div>
11
+ <div class="littleItem littleItem7"></div>
12
+ <div class="littleItem littleItem8"></div>
13
+ <div class="littleItem littleItem9"></div>
14
+ </div>
15
+ <div class="item item2">
16
+ <div class="littleItem littleItem1"></div>
17
+ <div class="littleItem littleItem2"></div>
18
+ <div class="littleItem littleItem3"></div>
19
+ <div class="littleItem littleItem4"></div>
20
+ <div class="littleItem littleItem5"></div>
21
+ <div class="littleItem littleItem6"></div>
22
+ <div class="littleItem littleItem7"></div>
23
+ <div class="littleItem littleItem8"></div>
24
+ <div class="littleItem littleItem9"></div>
25
+ </div>
26
+ <div class="item item3">
27
+ <div class="littleItem littleItem1"></div>
28
+ <div class="littleItem littleItem2"></div>
29
+ <div class="littleItem littleItem3"></div>
30
+ <div class="littleItem littleItem4"></div>
31
+ <div class="littleItem littleItem5"></div>
32
+ <div class="littleItem littleItem6"></div>
33
+ <div class="littleItem littleItem7"></div>
34
+ <div class="littleItem littleItem8"></div>
35
+ <div class="littleItem littleItem9"></div>
36
+ </div>
37
+ <div class="item item4">
38
+ <div class="littleItem littleItem1"></div>
39
+ <div class="littleItem littleItem2"></div>
40
+ <div class="littleItem littleItem3"></div>
41
+ <div class="littleItem littleItem4"></div>
42
+ <div class="littleItem littleItem5"></div>
43
+ <div class="littleItem littleItem6"></div>
44
+ <div class="littleItem littleItem7"></div>
45
+ <div class="littleItem littleItem8"></div>
46
+ <div class="littleItem littleItem9"></div>
47
+ </div>
48
+ <div class="item item5">
49
+ <div class="littleItem littleItem1"></div>
50
+ <div class="littleItem littleItem2"></div>
51
+ <div class="littleItem littleItem3"></div>
52
+ <div class="littleItem littleItem4"></div>
53
+ <div class="littleItem littleItem5"></div>
54
+ <div class="littleItem littleItem6"></div>
55
+ <div class="littleItem littleItem7"></div>
56
+ <div class="littleItem littleItem8"></div>
57
+ <div class="littleItem littleItem9"></div>
58
+ </div>
59
+ <div class="item item6">
60
+ <div class="littleItem littleItem1"></div>
61
+ <div class="littleItem littleItem2"></div>
62
+ <div class="littleItem littleItem3"></div>
63
+ <div class="littleItem littleItem4"></div>
64
+ <div class="littleItem littleItem5"></div>
65
+ <div class="littleItem littleItem6"></div>
66
+ <div class="littleItem littleItem7"></div>
67
+ <div class="littleItem littleItem8"></div>
68
+ <div class="littleItem littleItem9"></div>
69
+ </div>
70
+ <div class="item item7">
71
+ <div class="littleItem littleItem1"></div>
72
+ <div class="littleItem littleItem2"></div>
73
+ <div class="littleItem littleItem3"></div>
74
+ <div class="littleItem littleItem4"></div>
75
+ <div class="littleItem littleItem5"></div>
76
+ <div class="littleItem littleItem6"></div>
77
+ <div class="littleItem littleItem7"></div>
78
+ <div class="littleItem littleItem8"></div>
79
+ <div class="littleItem littleItem9"></div>
80
+ </div>
81
+ <div class="item item8">
82
+ <div class="littleItem littleItem1"></div>
83
+ <div class="littleItem littleItem2"></div>
84
+ <div class="littleItem littleItem3"></div>
85
+ <div class="littleItem littleItem4"></div>
86
+ <div class="littleItem littleItem5"></div>
87
+ <div class="littleItem littleItem6"></div>
88
+ <div class="littleItem littleItem7"></div>
89
+ <div class="littleItem littleItem8"></div>
90
+ <div class="littleItem littleItem9"></div>
91
+ </div>
92
+ <div class="item item9">
93
+ <div class="littleItem littleItem1"></div>
94
+ <div class="littleItem littleItem2"></div>
95
+ <div class="littleItem littleItem3"></div>
96
+ <div class="littleItem littleItem4"></div>
97
+ <div class="littleItem littleItem5"></div>
98
+ <div class="littleItem littleItem6"></div>
99
+ <div class="littleItem littleItem7"></div>
100
+ <div class="littleItem littleItem8"></div>
101
+ <div class="littleItem littleItem9"></div>
102
+ </div>
103
+ </div>
104
+ </template>
105
+
106
+ <script setup>
107
+ import { shallowRef, onMounted } from "vue";
108
+ import { useFocusHub } from "jsview";
109
+
110
+ const focusHub = useFocusHub();
111
+ const props = defineProps({
112
+ data: Object,
113
+ query: Object,
114
+ onEdge: Function,
115
+ onAction: Object,
116
+ getStyleClass: Function,
117
+ num: Number,
118
+ });
119
+
120
+ let posterChange = shallowRef("blurPoster");
121
+ const onFocus = () => {
122
+ posterChange.value = "focusPoster";
123
+ };
124
+
125
+ const onBlur = () => {
126
+ posterChange.value = "blurPoster";
127
+ };
128
+
129
+ props.onAction.register("onFocus", onFocus);
130
+ props.onAction.register("onBlur", onBlur);
131
+ props.onAction.register("onEdge", props.onEdge);
132
+
133
+ onMounted(() => {
134
+ focusHub.setFocus("ClassShow");
135
+ });
136
+ </script>
137
+
138
+ <style lang="scss" scoped>
139
+ .poster {
140
+ width: 140;
141
+ height: 160;
142
+ background-color: #bbbbaa;
143
+ }
144
+ .titleShow {
145
+ width: 140;
146
+ height: 40;
147
+ line-height: 40;
148
+ font-size: 24;
149
+ top: 120;
150
+ background-color: #ffffff;
151
+ text-align: center;
152
+ }
153
+ .focusPoster {
154
+ background-color: #dd8888;
155
+ }
156
+ .blurPoster {
157
+ background-color: #bbbbaa;
158
+ }
159
+ .item {
160
+ width: 40;
161
+ height: 40;
162
+ }
163
+ .item1 {
164
+ top: 3;
165
+ left: 3;
166
+ background-color: #aa3123;
167
+ }
168
+ .item2 {
169
+ top: 3;
170
+ left: 3+46;
171
+ background-color: #b0c847;
172
+ }
173
+ .item3 {
174
+ top: 3;
175
+ left: 3+46+46;
176
+ background-color: #5cb720;
177
+ }
178
+ .item4 {
179
+ top: 3+46;
180
+ left: 3;
181
+ background-color: #1db39d;
182
+ }
183
+ .item5 {
184
+ top: 3+46;
185
+ left: 3+46;
186
+ background-color: #a75b17;
187
+ }
188
+ .item6 {
189
+ top: 3+46;
190
+ left: 3+46+46;
191
+ background-color: #135ac3;
192
+ }
193
+ .item7 {
194
+ top: 3+46+46;
195
+ left: 3;
196
+ background-color: #af19d9;
197
+ }
198
+ .item8 {
199
+ top: 3+46+46;
200
+ left: 3+46;
201
+ background-color: #da308b;
202
+ }
203
+ .item9 {
204
+ top: 3+46+46;
205
+ left: 3+46+46;
206
+ background-color: #da2b2b;
207
+ }
208
+ .littleItem {
209
+ width: 10;
210
+ height: 10;
211
+ }
212
+ .littleItem1 {
213
+ top: 1;
214
+ left: 1;
215
+ background-color: #1135a1;
216
+ }
217
+ .littleItem2 {
218
+ top: 1;
219
+ left: 1+13;
220
+ background-color: #aab6db;
221
+ }
222
+ .littleItem3 {
223
+ top: 1;
224
+ left: 1+13+13;
225
+ background-color: #35194d;
226
+ }
227
+ .littleItem4 {
228
+ top: 1+13;
229
+ left: 1;
230
+ background-color: #a2023a;
231
+ }
232
+ .littleItem5 {
233
+ top: 1+13;
234
+ left: 1+13;
235
+ background-color: #e13470;
236
+ }
237
+ .littleItem6 {
238
+ top: 1+13;
239
+ left: 1+13+13;
240
+ background-color: #d935e8;
241
+ }
242
+ .littleItem7 {
243
+ top: 1+13+13;
244
+ left: 1;
245
+ background-color: #2f63dc;
246
+ }
247
+ .littleItem8 {
248
+ top: 1+13+13;
249
+ left: 1+13;
250
+ background-color: #240ee2;
251
+ }
252
+ .littleItem9 {
253
+ top: 1+13+13;
254
+ left: 1+13+13;
255
+ background-color: #2fdbb9;
256
+ }
257
+ </style>
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <div class="bg">
3
+ <div class="bg-adjust">
4
+ <metro-widget
5
+ name="ClassShow"
6
+ ref="classRef"
7
+ :width="props.style.width"
8
+ :height="props.style.height"
9
+ :provideData="provideData"
10
+ :direction="HORIZONTAL"
11
+ :measures="measures"
12
+ :onEdge="onEdge"
13
+ :padding="props.style.padding"
14
+ :sendFocusRectEvent="true"
15
+ >
16
+ <template #renderItem="{ data, query, onEdge, onAction }">
17
+ <ClassItem
18
+ :data="data"
19
+ :query="query"
20
+ :onEdge="onEdge"
21
+ :onAction="onAction"
22
+ />
23
+ </template>
24
+ </metro-widget>
25
+ </div>
26
+ </div>
27
+ </template>
28
+
29
+ <script setup>
30
+ import { inject, shallowRef, watch } from "vue";
31
+ import { MetroWidget, HORIZONTAL } from "jsview";
32
+ import ClassItem from "./ClassItem.vue";
33
+ const props = defineProps({
34
+ style: Object,
35
+ data: Array,
36
+ });
37
+ let classRef = shallowRef(null);
38
+ let change = inject("change");
39
+
40
+ const provideData = () => {
41
+ if (change.value) {
42
+ const data = props.data.slice(33, 65);
43
+ return data;
44
+ } else {
45
+ const data = props.data.slice(0, 32);
46
+ return data;
47
+ }
48
+ };
49
+ watch(change, (n, o) => {
50
+ if (n !== o) {
51
+ provideData();
52
+ classRef.value?.refreshData(true);
53
+ }
54
+ });
55
+ const measures = (item) => {
56
+ return {
57
+ ...item,
58
+ focusable: true,
59
+ marginRight: 20,
60
+ marginBottom: 20,
61
+ };
62
+ };
63
+ const onEdge = () => {
64
+ console.log("到边缘了");
65
+ };
66
+
67
+ </script>
68
+
69
+ <style lang="scss" scoped>
70
+ .bg {
71
+ width: 1280;
72
+ height: 720;
73
+ background-color: #006400;
74
+ .bg-adjust{
75
+ top:10
76
+ }
77
+ }
78
+ </style>
@@ -0,0 +1,165 @@
1
+ <template>
2
+ <div
3
+ :style="{
4
+ width: 140,
5
+ height: 160,
6
+ backgroundColor: focused ? '#DD8888' : '#BBBBAA',
7
+ }"
8
+ >
9
+ <div
10
+ :style="{
11
+ width: 140,
12
+ height: 40,
13
+ lineHeight: 40,
14
+ fontSize: 24,
15
+ top: 120,
16
+ backgroundColor: '#FFFFFF',
17
+ textAlign: 'center',
18
+ }"
19
+ >
20
+ {{ props.data.title }}
21
+ </div>
22
+ <div :style="{top:3,left:3,width:40,height:40,backgroundColor:'#AA3123'}">
23
+ <div :style="{top:1,left:1,width:10,height:10,backgroundColor:'#1135a1'}"></div>
24
+ <div :style="{top:1,left:1+13,width:10,height:10,backgroundColor:'#aab6db'}"></div>
25
+ <div :style="{top:1,left:1+13+13,width:10,height:10,backgroundColor:'#35194d'}"></div>
26
+ <div :style="{top:1+13,left:1,width:10,height:10,backgroundColor:'#a2023a'}"></div>
27
+ <div :style="{top:1+13,left:1+13,width:10,height:10,backgroundColor:'#e13470'}"></div>
28
+ <div :style="{top:1+13,left:1+13+13,width:10,height:10,backgroundColor:'#d935e8'}"></div>
29
+ <div :style="{top:1+13+13,left:1,width:10,height:10,backgroundColor:'#2f63dc'}"></div>
30
+ <div :style="{top:1+13+13,left:1+13,width:10,height:10,backgroundColor:'#240ee2'}"></div>
31
+ <div :style="{top:1+13+13,left:1+13+13,width:10,height:10,backgroundColor:'#2fdbb9'}"></div>
32
+ </div>
33
+
34
+ <div :style="{top:3,left:3+46,width:40,height:40,backgroundColor:'#b0c847'}">
35
+ <div :style="{top:1,left:1,width:10,height:10,backgroundColor:'#1135a1'}"></div>
36
+ <div :style="{top:1,left:1+13,width:10,height:10,backgroundColor:'#aab6db'}"></div>
37
+ <div :style="{top:1,left:1+13+13,width:10,height:10,backgroundColor:'#35194d'}"></div>
38
+ <div :style="{top:1+13,left:1,width:10,height:10,backgroundColor:'#a2023a'}"></div>
39
+ <div :style="{top:1+13,left:1+13,width:10,height:10,backgroundColor:'#e13470'}"></div>
40
+ <div :style="{top:1+13,left:1+13+13,width:10,height:10,backgroundColor:'#d935e8'}"></div>
41
+ <div :style="{top:1+13+13,left:1,width:10,height:10,backgroundColor:'#2f63dc'}"></div>
42
+ <div :style="{top:1+13+13,left:1+13,width:10,height:10,backgroundColor:'#240ee2'}"></div>
43
+ <div :style="{top:1+13+13,left:1+13+13,width:10,height:10,backgroundColor:'#2fdbb9'}"></div>
44
+ </div>
45
+
46
+ <div :style="{top:3,left:3+46+46,width:40,height:40,backgroundColor:'#5cb720'}">
47
+ <div :style="{top:1,left:1,width:10,height:10,backgroundColor:'#1135a1'}"></div>
48
+ <div :style="{top:1,left:1+13,width:10,height:10,backgroundColor:'#aab6db'}"></div>
49
+ <div :style="{top:1,left:1+13+13,width:10,height:10,backgroundColor:'#35194d'}"></div>
50
+ <div :style="{top:1+13,left:1,width:10,height:10,backgroundColor:'#a2023a'}"></div>
51
+ <div :style="{top:1+13,left:1+13,width:10,height:10,backgroundColor:'#e13470'}"></div>
52
+ <div :style="{top:1+13,left:1+13+13,width:10,height:10,backgroundColor:'#d935e8'}"></div>
53
+ <div :style="{top:1+13+13,left:1,width:10,height:10,backgroundColor:'#2f63dc'}"></div>
54
+ <div :style="{top:1+13+13,left:1+13,width:10,height:10,backgroundColor:'#240ee2'}"></div>
55
+ <div :style="{top:1+13+13,left:1+13+13,width:10,height:10,backgroundColor:'#2fdbb9'}"></div>
56
+ </div>
57
+
58
+ <div :style="{top:3+46,left:3,width:40,height:40,backgroundColor:'#1db39d'}">
59
+ <div :style="{top:1,left:1,width:10,height:10,backgroundColor:'#1135a1'}"></div>
60
+ <div :style="{top:1,left:1+13,width:10,height:10,backgroundColor:'#aab6db'}"></div>
61
+ <div :style="{top:1,left:1+13+13,width:10,height:10,backgroundColor:'#35194d'}"></div>
62
+ <div :style="{top:1+13,left:1,width:10,height:10,backgroundColor:'#a2023a'}"></div>
63
+ <div :style="{top:1+13,left:1+13,width:10,height:10,backgroundColor:'#e13470'}"></div>
64
+ <div :style="{top:1+13,left:1+13+13,width:10,height:10,backgroundColor:'#d935e8'}"></div>
65
+ <div :style="{top:1+13+13,left:1,width:10,height:10,backgroundColor:'#2f63dc'}"></div>
66
+ <div :style="{top:1+13+13,left:1+13,width:10,height:10,backgroundColor:'#240ee2'}"></div>
67
+ <div :style="{top:1+13+13,left:1+13+13,width:10,height:10,backgroundColor:'#2fdbb9'}"></div>
68
+ </div>
69
+
70
+ <div :style="{top:3+46,left:3+46,width:40,height:40,backgroundColor:'#a75b17'}">
71
+ <div :style="{top:1,left:1,width:10,height:10,backgroundColor:'#1135a1'}"></div>
72
+ <div :style="{top:1,left:1+13,width:10,height:10,backgroundColor:'#aab6db'}"></div>
73
+ <div :style="{top:1,left:1+13+13,width:10,height:10,backgroundColor:'#35194d'}"></div>
74
+ <div :style="{top:1+13,left:1,width:10,height:10,backgroundColor:'#a2023a'}"></div>
75
+ <div :style="{top:1+13,left:1+13,width:10,height:10,backgroundColor:'#e13470'}"></div>
76
+ <div :style="{top:1+13,left:1+13+13,width:10,height:10,backgroundColor:'#d935e8'}"></div>
77
+ <div :style="{top:1+13+13,left:1,width:10,height:10,backgroundColor:'#2f63dc'}"></div>
78
+ <div :style="{top:1+13+13,left:1+13,width:10,height:10,backgroundColor:'#240ee2'}"></div>
79
+ <div :style="{top:1+13+13,left:1+13+13,width:10,height:10,backgroundColor:'#2fdbb9'}"></div>
80
+ </div>
81
+
82
+ <div :style="{top:3+46,left:3+46+46,width:40,height:40,backgroundColor:'#135ac3'}">
83
+ <div :style="{top:1,left:1,width:10,height:10,backgroundColor:'#1135a1'}"></div>
84
+ <div :style="{top:1,left:1+13,width:10,height:10,backgroundColor:'#aab6db'}"></div>
85
+ <div :style="{top:1,left:1+13+13,width:10,height:10,backgroundColor:'#35194d'}"></div>
86
+ <div :style="{top:1+13,left:1,width:10,height:10,backgroundColor:'#a2023a'}"></div>
87
+ <div :style="{top:1+13,left:1+13,width:10,height:10,backgroundColor:'#e13470'}"></div>
88
+ <div :style="{top:1+13,left:1+13+13,width:10,height:10,backgroundColor:'#d935e8'}"></div>
89
+ <div :style="{top:1+13+13,left:1,width:10,height:10,backgroundColor:'#2f63dc'}"></div>
90
+ <div :style="{top:1+13+13,left:1+13,width:10,height:10,backgroundColor:'#240ee2'}"></div>
91
+ <div :style="{top:1+13+13,left:1+13+13,width:10,height:10,backgroundColor:'#2fdbb9'}"></div>
92
+ </div>
93
+
94
+ <div :style="{top:3+46+46,left:3,width:40,height:40,backgroundColor:'#af19d9'}">
95
+ <div :style="{top:1,left:1,width:10,height:10,backgroundColor:'#1135a1'}"></div>
96
+ <div :style="{top:1,left:1+13,width:10,height:10,backgroundColor:'#aab6db'}"></div>
97
+ <div :style="{top:1,left:1+13+13,width:10,height:10,backgroundColor:'#35194d'}"></div>
98
+ <div :style="{top:1+13,left:1,width:10,height:10,backgroundColor:'#a2023a'}"></div>
99
+ <div :style="{top:1+13,left:1+13,width:10,height:10,backgroundColor:'#e13470'}"></div>
100
+ <div :style="{top:1+13,left:1+13+13,width:10,height:10,backgroundColor:'#d935e8'}"></div>
101
+ <div :style="{top:1+13+13,left:1,width:10,height:10,backgroundColor:'#2f63dc'}"></div>
102
+ <div :style="{top:1+13+13,left:1+13,width:10,height:10,backgroundColor:'#240ee2'}"></div>
103
+ <div :style="{top:1+13+13,left:1+13+13,width:10,height:10,backgroundColor:'#2fdbb9'}"></div>
104
+ </div>
105
+
106
+ <div :style="{top:3+46+46,left:3+46,width:40,height:40,backgroundColor:'#da308b'}">
107
+ <div :style="{top:1,left:1,width:10,height:10,backgroundColor:'#1135a1'}"></div>
108
+ <div :style="{top:1,left:1+13,width:10,height:10,backgroundColor:'#aab6db'}"></div>
109
+ <div :style="{top:1,left:1+13+13,width:10,height:10,backgroundColor:'#35194d'}"></div>
110
+ <div :style="{top:1+13,left:1,width:10,height:10,backgroundColor:'#a2023a'}"></div>
111
+ <div :style="{top:1+13,left:1+13,width:10,height:10,backgroundColor:'#e13470'}"></div>
112
+ <div :style="{top:1+13,left:1+13+13,width:10,height:10,backgroundColor:'#d935e8'}"></div>
113
+ <div :style="{top:1+13+13,left:1,width:10,height:10,backgroundColor:'#2f63dc'}"></div>
114
+ <div :style="{top:1+13+13,left:1+13,width:10,height:10,backgroundColor:'#240ee2'}"></div>
115
+ <div :style="{top:1+13+13,left:1+13+13,width:10,height:10,backgroundColor:'#2fdbb9'}"></div>
116
+ </div>
117
+
118
+ <div :style="{top:3+46+46,left:3+46+46,width:40,height:40,backgroundColor:'#da2b2b'}">
119
+ <div :style="{top:1,left:1,width:10,height:10,backgroundColor:'#1135a1'}"></div>
120
+ <div :style="{top:1,left:1+13,width:10,height:10,backgroundColor:'#aab6db'}"></div>
121
+ <div :style="{top:1,left:1+13+13,width:10,height:10,backgroundColor:'#35194d'}"></div>
122
+ <div :style="{top:1+13,left:1,width:10,height:10,backgroundColor:'#a2023a'}"></div>
123
+ <div :style="{top:1+13,left:1+13,width:10,height:10,backgroundColor:'#e13470'}"></div>
124
+ <div :style="{top:1+13,left:1+13+13,width:10,height:10,backgroundColor:'#d935e8'}"></div>
125
+ <div :style="{top:1+13+13,left:1,width:10,height:10,backgroundColor:'#2f63dc'}"></div>
126
+ <div :style="{top:1+13+13,left:1+13,width:10,height:10,backgroundColor:'#240ee2'}"></div>
127
+ <div :style="{top:1+13+13,left:1+13+13,width:10,height:10,backgroundColor:'#2fdbb9'}"></div>
128
+ </div>
129
+
130
+ </div>
131
+ </template>
132
+
133
+ <script setup>
134
+ import { shallowRef, onMounted } from "vue";
135
+ import { useFocusHub } from "jsview";
136
+ const focusHub = useFocusHub();
137
+ const props = defineProps({
138
+ data: Object,
139
+ query: Object,
140
+ onEdge: Function,
141
+ onAction: Object,
142
+ getStyleClass: Function,
143
+ num: Number,
144
+ });
145
+
146
+ let focused = shallowRef(false);
147
+ const onFocus = () => {
148
+ focused.value = "grow";
149
+ };
150
+
151
+ const onBlur = () => {
152
+ focused.value = false;
153
+ };
154
+
155
+
156
+ props.onAction.register("onFocus", onFocus);
157
+ props.onAction.register("onBlur", onBlur);
158
+ props.onAction.register("onEdge", props.onEdge);
159
+
160
+ onMounted(() => {
161
+ focusHub.setFocus("StyleShow");
162
+ });
163
+ </script>
164
+
165
+ <style lang="scss" scoped></style>
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <div :style="{ backgroundColor: '#87CEEB', width: 1280, height: 720 }">
3
+ <div :style="{ top: 10 }">
4
+ <metro-widget
5
+ name="StyleShow"
6
+ ref="styleRef"
7
+ :width="props.style.width"
8
+ :height="props.style.height"
9
+ :provideData="provideData"
10
+ :direction="HORIZONTAL"
11
+ :measures="measures"
12
+ :onEdge="onEdge"
13
+ :padding="props.style.padding"
14
+ :sendFocusRectEvent="true"
15
+ >
16
+ <template #renderItem="{ data, query, onEdge, onAction }">
17
+ <StyleItem
18
+ :data="data"
19
+ :query="query"
20
+ :onEdge="onEdge"
21
+ :onAction="onAction"
22
+ />
23
+ </template>
24
+ </metro-widget>
25
+ </div>
26
+ </div>
27
+ </template>
28
+
29
+ <script setup>
30
+ import { inject, shallowRef, watch } from "vue";
31
+ import { MetroWidget, HORIZONTAL } from "jsview";
32
+ import StyleItem from "./StyleItem.vue";
33
+ const props = defineProps({
34
+ style: Object,
35
+ data: Array,
36
+ });
37
+ let styleRef = shallowRef(null);
38
+ let change = inject("change");
39
+
40
+ const provideData = () => {
41
+ if (change.value) {
42
+ const data = props.data.slice(33, 65);
43
+ return data;
44
+ } else {
45
+ const data = props.data.slice(0, 32);
46
+ return data;
47
+ }
48
+ };
49
+ watch(change, (n, o) => {
50
+ if (n !== o) {
51
+ provideData();
52
+ styleRef.value?.refreshData(true);
53
+ }
54
+ });
55
+ const measures = (item) => {
56
+ return {
57
+ ...item,
58
+ focusable: true,
59
+ marginRight: 20,
60
+ marginBottom: 20,
61
+ };
62
+ };
63
+ const onEdge = () => {
64
+ console.log("到边缘了");
65
+ };
66
+ </script>
67
+
68
+ <style lang="scss" scoped></style>
@@ -1,7 +1,7 @@
1
1
  import { createRouter } from 'vue-router';
2
2
  import { jsvCreateHashHistory } from 'jsview';
3
3
  import { metroWidgetRouteList } from "../MetroWidgetDemos"
4
- let routeList = [
4
+ let routeList = [
5
5
  // 功能实例
6
6
  {
7
7
  name: 'Home',
@@ -16,6 +16,16 @@ let routeList = [
16
16
  path: '/feature/Basic',
17
17
  component: () => import('jsview-vue-samples/Basic/App.vue'),
18
18
  },
19
+ {
20
+ name: '饼图测试',
21
+ path: '/feature/SecTorTest',
22
+ component: () => import('jsview-vue-samples/SecTorTest/App.vue'),
23
+ },
24
+ {
25
+ name: 'TextureStore测试',
26
+ path: '/feature/TextureStoreTest',
27
+ component: () => import('jsview-vue-samples/TextureStoreTest/App.vue'),
28
+ },
19
29
  {
20
30
  name: 'NativeSharedView测试',
21
31
  path: '/feature/TestNativeSharedView',
@@ -193,34 +203,78 @@ let routeList = [
193
203
  component: () => import('jsview-vue-samples/MockjsDemo/App.vue'),
194
204
  },
195
205
  {
196
- name:'红包雨',
197
- path:'/Game/GiftRain',
198
- component:()=>import('jsview-vue-samples/GiftRain/App.vue'),
206
+ name: '红包雨',
207
+ path: '/Game/GiftRain',
208
+ component: () => import('jsview-vue-samples/GiftRain/App.vue'),
199
209
  },
200
210
  {
201
- name:'雷达图',
202
- path:'/Game/RadarChart',
203
- component:()=>import('jsview-vue-samples/JsvRadarChart/App.vue')
211
+ name: '雷达图',
212
+ path: '/Game/RadarChart',
213
+ component: () => import('jsview-vue-samples/JsvRadarChart/App.vue')
204
214
  },
205
215
  {
206
- name:'跑酷游戏',
207
- path:'/Game/Parkour',
208
- component:()=>import('jsview-vue-samples/Parkour/App.vue')
216
+ name: '跑酷游戏',
217
+ path: '/Game/Parkour',
218
+ component: () => import('jsview-vue-samples/Parkour/App.vue')
209
219
  },
210
220
  {
211
221
  name: 'Hash参数',
212
222
  path: '/feature/HashParams',
213
223
  component: () => import('jsview-vue-samples/HashParams/App.vue'),
214
224
  },
225
+ {
226
+ name: '按键打断描画',
227
+ path: '/feature/BreakRender',
228
+ component: () => import('jsview-vue-samples/BreakRender/App.vue'),
229
+ },
230
+ {
231
+ name: 'latex示例',
232
+ path: '/feature/LatexDemo',
233
+ component: () => import('jsview-vue-samples/LatexDemo/App.vue'),
234
+ },
235
+ {
236
+ name: 'GetRect示例',
237
+ path: '/feature/GetRect',
238
+ component: () => import('jsview-vue-samples/GetBoundingClientRect/App.vue'),
239
+ },
240
+ {
241
+ name: '动态Class示例',
242
+ path: '/feature/DynamicClass',
243
+ component: () => import('jsview-vue-samples/DynamicClass/App.vue'),
244
+ },
245
+ {
246
+ name: 'Class动态切换示例',
247
+ path: '/feature/ClassDynamicSwitching',
248
+ component: () => import('jsview-vue-samples/ClassDynamicSwitching/App.vue'),
249
+ },
250
+ {
251
+ name: 'JsvLine示例',
252
+ path: '/feature/JsvLine',
253
+ component: () => import('jsview-vue-samples/JsvLine/App.vue'),
254
+ },
255
+ {
256
+ name: 'FreeMove示例',
257
+ path: '/feature/FreeMove',
258
+ component: () => import('jsview-vue-samples/FreeMove/App.vue'),
259
+ },
260
+ {
261
+ name: '思维导图示例',
262
+ path: '/feature/MindMap',
263
+ component: () => import('jsview-vue-samples/MindMap/App.vue'),
264
+ },
265
+ {
266
+ name: 'latex公式',
267
+ path: '/feature/LatexFormula',
268
+ component: () => import('jsview-vue-samples/LatexFormula/App.vue'),
269
+ }
215
270
  ];
216
271
 
217
272
  //添加MetroWidget demo
218
273
  routeList = routeList.concat(metroWidgetRouteList);
219
274
 
220
275
  const router = createRouter({
221
- // 浏览器调试和盒子上都可以使用类WebHashHistoryjsvCreateHashHistory(推荐)
222
- // 或 createMemoryHistory;
223
- // createWebHashHistory只能用于浏览器调试,盒子不支持
276
+ // 浏览器调试和盒子上都可以使用功能与WebHashHistory相同的jsvCreateHashHistory(推荐)
277
+ // 因为createWebHashHistory只能用于PC浏览器模拟环境调试,盒子不支持
224
278
  history: jsvCreateHashHistory(),
225
279
  routes: routeList,
226
280
  });