@shijiu/jsview-vue 1.9.727 → 1.9.747

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 (217) hide show
  1. package/index.d.ts +4 -1
  2. package/index.js +4 -1
  3. package/package.json +5 -16
  4. package/samples/AnimPicture/App.vue +0 -207
  5. package/samples/AnimPicture/assets/animated_webp.webp +0 -0
  6. package/samples/AnimPicture/assets/ball_3.webp +0 -0
  7. package/samples/AnimPicture/assets/girl_run.gif +0 -0
  8. package/samples/AnimPicture/assets/quan.webp +0 -0
  9. package/samples/Basic/App.vue +0 -134
  10. package/samples/Basic/assets/border.png +0 -0
  11. package/samples/Basic/assets/border2.png +0 -0
  12. package/samples/Basic/assets/icon.png +0 -0
  13. package/samples/Basic/assets/test.jpg +0 -0
  14. package/samples/Basic/components/ContentBlock.vue +0 -38
  15. package/samples/Basic/components/FontStyle.css +0 -16
  16. package/samples/Basic/components/anim/AnimGroup.vue +0 -66
  17. package/samples/Basic/components/anim/AnimKeyframeBasic.vue +0 -119
  18. package/samples/Basic/components/anim/AnimKeyframeComposite.vue +0 -52
  19. package/samples/Basic/components/anim/AnimTransition.vue +0 -157
  20. package/samples/Basic/components/div/DivBackground.vue +0 -44
  21. package/samples/Basic/components/div/DivClip.vue +0 -159
  22. package/samples/Basic/components/div/DivCssScoped.vue +0 -20
  23. package/samples/Basic/components/div/DivCssVar.vue +0 -53
  24. package/samples/Basic/components/div/DivGroup1.vue +0 -47
  25. package/samples/Basic/components/div/DivGroup2.vue +0 -65
  26. package/samples/Basic/components/div/DivLayout.vue +0 -70
  27. package/samples/Basic/components/div/DivRadius.vue +0 -65
  28. package/samples/Basic/components/div/DivTransform.vue +0 -32
  29. package/samples/Basic/components/img/ImageGroup.vue +0 -31
  30. package/samples/Basic/components/img/ImgLayout.vue +0 -41
  31. package/samples/Basic/components/panel/Panel1.vue +0 -55
  32. package/samples/Basic/components/panel/Panel2.vue +0 -31
  33. package/samples/Basic/components/panel/TitleBar.vue +0 -29
  34. package/samples/Basic/components/text/TextAlign.vue +0 -66
  35. package/samples/Basic/components/text/TextEmoji.vue +0 -26
  36. package/samples/Basic/components/text/TextFontStyle.vue +0 -89
  37. package/samples/Basic/components/text/TextGroup1.vue +0 -49
  38. package/samples/Basic/components/text/TextGroup2.vue +0 -28
  39. package/samples/Basic/components/text/TextOverflow.vue +0 -110
  40. package/samples/BasicFocusControl/App.vue +0 -104
  41. package/samples/BasicFocusControl/components/BaseBlock.vue +0 -50
  42. package/samples/BasicFocusControl/components/MainArea.vue +0 -83
  43. package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +0 -17
  44. package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +0 -27
  45. package/samples/BasicFocusControl/components/SideBar.vue +0 -58
  46. package/samples/BasicFocusControl/components/SideBarBlock.vue +0 -27
  47. package/samples/Collision/App.vue +0 -452
  48. package/samples/ColorSpace/App.vue +0 -126
  49. package/samples/DemoHomepage/App.vue +0 -27
  50. package/samples/DemoHomepage/components/BodyFrame.vue +0 -95
  51. package/samples/DemoHomepage/components/Dialog.vue +0 -94
  52. package/samples/DemoHomepage/components/Item.vue +0 -77
  53. package/samples/DemoHomepage/components/TabFrame.vue +0 -85
  54. package/samples/DemoHomepage/router.js +0 -196
  55. package/samples/DemoHomepage/views/Homepage.vue +0 -195
  56. package/samples/FilterDemo/AnimatePic.vue +0 -58
  57. package/samples/FilterDemo/App.vue +0 -159
  58. package/samples/FilterDemo/VideoLayer.vue +0 -62
  59. package/samples/FlipCard/App.vue +0 -71
  60. package/samples/FlipCard/FlipCard.vue +0 -118
  61. package/samples/FlipCard/assets/blue_egg.png +0 -0
  62. package/samples/FlipCard/assets/red_egg.png +0 -0
  63. package/samples/FlipCard/data.js +0 -13
  64. package/samples/GridDemo/App.vue +0 -215
  65. package/samples/GridDemo/ButtonBlock.vue +0 -112
  66. package/samples/GridDemo/FocusItem.vue +0 -37
  67. package/samples/GridDemo/Item.vue +0 -93
  68. package/samples/HashHistory/App.vue +0 -115
  69. package/samples/HashHistory/components/HorizontalButtonList.vue +0 -91
  70. package/samples/HashHistory/components/Item.vue +0 -60
  71. package/samples/HashHistory/router.js +0 -41
  72. package/samples/HashHistory/views/MainPage.vue +0 -57
  73. package/samples/HashHistory/views/SubPage.vue +0 -66
  74. package/samples/ImpactStop/App.vue +0 -435
  75. package/samples/Input/App.vue +0 -164
  76. package/samples/Input/FullKeyboard.vue +0 -87
  77. package/samples/Input/InputPanel.vue +0 -131
  78. package/samples/Input/KeyboardItem.vue +0 -58
  79. package/samples/LongImage/App.vue +0 -80
  80. package/samples/LongImage/Button.vue +0 -58
  81. package/samples/LongImage/ButtonItem.vue +0 -44
  82. package/samples/LongImage/LongImageScroll.vue +0 -92
  83. package/samples/LongImage/Scroll.vue +0 -14
  84. package/samples/LongImage/assets/1280x7200.jpg +0 -0
  85. package/samples/LongText/App.vue +0 -96
  86. package/samples/LongText/Button.vue +0 -51
  87. package/samples/LongText/ButtonItem.vue +0 -44
  88. package/samples/LongText/LongTextScroll.vue +0 -192
  89. package/samples/LongText/Scroll.vue +0 -14
  90. package/samples/Marquee/App.vue +0 -247
  91. package/samples/Marquee/longText.js +0 -14
  92. package/samples/MaskClip/App.vue +0 -122
  93. package/samples/MaskClip/images/mask-025/config.json +0 -29
  94. package/samples/MaskClip/images/mask-025/res/1.png +0 -0
  95. package/samples/MaskClip/images/mask-025/res/2.png +0 -0
  96. package/samples/MaskClip/images/mask-025/res/3.png +0 -0
  97. package/samples/MaskClip/images/mask-025/res/4.png +0 -0
  98. package/samples/MaskClip/images/mask-025/res/icon.png +0 -0
  99. package/samples/MaskClip/images/mask-025/res/stroke.png +0 -0
  100. package/samples/MaskClip/images/php.jpg +0 -0
  101. package/samples/MetroWidgetDemos/Advanced/App.vue +0 -46
  102. package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +0 -90
  103. package/samples/MetroWidgetDemos/Advanced/Buttons.vue +0 -70
  104. package/samples/MetroWidgetDemos/Advanced/Mixed.vue +0 -77
  105. package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +0 -83
  106. package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +0 -89
  107. package/samples/MetroWidgetDemos/Advanced/widgets/Widgets.vue +0 -116
  108. package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
  109. package/samples/MetroWidgetDemos/Item.vue +0 -85
  110. package/samples/MetroWidgetDemos/PerformanceTest/App.vue +0 -210
  111. package/samples/MetroWidgetDemos/PerformanceTest/Item.vue +0 -90
  112. package/samples/MetroWidgetDemos/PerformanceTest/assets/bg.jpg +0 -0
  113. package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_content.png +0 -0
  114. package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_left.png +0 -0
  115. package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_mid.png +0 -0
  116. package/samples/MetroWidgetDemos/PerformanceTest/assets/coupon_right.png +0 -0
  117. package/samples/MetroWidgetDemos/PerformanceTest/assets/focus_border.png +0 -0
  118. package/samples/MetroWidgetDemos/PerformanceTest/assets/holder_logo.png +0 -0
  119. package/samples/MetroWidgetDemos/PerformanceTest/assets/jrbm.png +0 -0
  120. package/samples/MetroWidgetDemos/PerformanceTest/assets/line_left.png +0 -0
  121. package/samples/MetroWidgetDemos/PerformanceTest/assets/line_mid.png +0 -0
  122. package/samples/MetroWidgetDemos/PerformanceTest/assets/line_right.png +0 -0
  123. package/samples/MetroWidgetDemos/PerformanceTest/assets/loading.png +0 -0
  124. package/samples/MetroWidgetDemos/PerformanceTest/assets/logo.png +0 -0
  125. package/samples/MetroWidgetDemos/PerformanceTest/assets/mcjx.png +0 -0
  126. package/samples/MetroWidgetDemos/PerformanceTest/assets/tao.png +0 -0
  127. package/samples/MetroWidgetDemos/PerformanceTest/assets/tmall.png +0 -0
  128. package/samples/MetroWidgetDemos/PerformanceTest/border.png +0 -0
  129. package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +0 -386
  130. package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +0 -129
  131. package/samples/MetroWidgetDemos/PerformanceTest/data.js +0 -45
  132. package/samples/MetroWidgetDemos/PingPong/App.vue +0 -135
  133. package/samples/MetroWidgetDemos/PingPong/AppPage.vue +0 -73
  134. package/samples/MetroWidgetDemos/PingPong/AppTab.vue +0 -62
  135. package/samples/MetroWidgetDemos/PingPong/TabItem.vue +0 -84
  136. package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +0 -214
  137. package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +0 -75
  138. package/samples/MetroWidgetDemos/Simple/App.vue +0 -45
  139. package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +0 -111
  140. package/samples/MetroWidgetDemos/WidgetItem.vue +0 -89
  141. package/samples/MetroWidgetDemos/data.js +0 -205
  142. package/samples/NinePatchDemo/App.vue +0 -145
  143. package/samples/NinePatchDemo/Item.vue +0 -69
  144. package/samples/NinePatchDemo/assets/border.png +0 -0
  145. package/samples/Preload/App.vue +0 -135
  146. package/samples/Preload/Item.vue +0 -32
  147. package/samples/Preload/data.js +0 -23
  148. package/samples/Preload/images/awesomeface.png +0 -0
  149. package/samples/Preload/images/cat.jpg +0 -0
  150. package/samples/Preload/images/rank.png +0 -0
  151. package/samples/Preload/images/rank_focus.png +0 -0
  152. package/samples/Preload/images/rule.png +0 -0
  153. package/samples/Preload/images/rule_focus.png +0 -0
  154. package/samples/Preload/images/start.png +0 -0
  155. package/samples/Preload/images/start_focus.png +0 -0
  156. package/samples/QrcodeDemo/App.vue +0 -68
  157. package/samples/ScaleDownNeon/App.vue +0 -107
  158. package/samples/SoundPool/App.vue +0 -134
  159. package/samples/SoundPool/bgmusic.mp3 +0 -0
  160. package/samples/SoundPool/coin.mp3 +0 -0
  161. package/samples/SoundPool/jump.mp3 +0 -0
  162. package/samples/SoundPool/lose.mp3 +0 -0
  163. package/samples/SoundPool/run.mp3 +0 -0
  164. package/samples/SprayView/App.vue +0 -272
  165. package/samples/SprayView/assets/snow.png +0 -0
  166. package/samples/SpriteImage/App.vue +0 -173
  167. package/samples/SpriteImage/images/cat_run.png +0 -0
  168. package/samples/SpriteImage/images/egg_break.json +0 -116
  169. package/samples/SpriteImage/images/egg_break.png +0 -0
  170. package/samples/SpriteImage/images/sprite.png +0 -0
  171. package/samples/TextBox/App.vue +0 -91
  172. package/samples/TextBox/RenderCenter.vue +0 -133
  173. package/samples/TextBox/RenderLeft.vue +0 -138
  174. package/samples/TextBox/RenderOneLine.vue +0 -101
  175. package/samples/TextBox/RenderRight.vue +0 -131
  176. package/samples/TextShadowDemo/App.vue +0 -91
  177. package/samples/TextureAnimation/App.vue +0 -336
  178. package/samples/TextureAnimation/App2.vue +0 -111
  179. package/samples/TextureAnimation/assets/blackWhiteGrid.png +0 -0
  180. package/samples/TextureAnimation/assets/light.png +0 -0
  181. package/samples/TextureAnimation/assets/light2.png +0 -0
  182. package/samples/TextureAnimation/assets/mask.png +0 -0
  183. package/samples/TextureAnimation/assets/php.jpg +0 -0
  184. package/samples/TextureAnimation/assets/php2.png +0 -0
  185. package/samples/TextureAnimation/assets/swipLight.png +0 -0
  186. package/samples/TextureSize/App.vue +0 -132
  187. package/samples/TextureSize/bmpDemo.bmp +0 -0
  188. package/samples/TextureSize/jpegDemo.jpeg +0 -0
  189. package/samples/TextureSize/jpgDemo.jpg +0 -0
  190. package/samples/TextureSize/pngDemo.png +0 -0
  191. package/samples/TextureSize/pngNoAlphaDemo.png +0 -0
  192. package/samples/ThrowMoveDemo/AccelerateDemo.vue +0 -116
  193. package/samples/ThrowMoveDemo/App.vue +0 -114
  194. package/samples/ThrowMoveDemo/LRParabolicDemo.vue +0 -115
  195. package/samples/ThrowMoveDemo/TargetDemo.vue +0 -116
  196. package/samples/ThrowMoveDemo/UDParabolicDemo.vue +0 -121
  197. package/samples/TouchSample/App.vue +0 -136
  198. package/samples/TouchSample/Item.vue +0 -103
  199. package/samples/TouchSample/MetroWidgetHorizontal.vue +0 -144
  200. package/samples/TouchSample/MetroWidgetVertical.vue +0 -144
  201. package/samples/TouchSample/TouchContainerHorizontal.vue +0 -160
  202. package/samples/TouchSample/TouchContainerVertical.vue +0 -160
  203. package/samples/TouchSample/data.js +0 -81
  204. package/samples/TransitPage/App.vue +0 -29
  205. package/samples/VideoDemo/App.vue +0 -121
  206. package/samples/VideoDemo/components/Button.vue +0 -58
  207. package/samples/VideoDemo/components/Controllor.vue +0 -197
  208. package/samples/VideoDemo/components/VideoFrame.vue +0 -140
  209. package/samples/VisibleSensorDemo/App.vue +0 -234
  210. package/samples/assets/bmpDemo.bmp +0 -0
  211. package/samples/assets/jpegDemo.jpeg +0 -0
  212. package/samples/assets/pngDemo.png +0 -0
  213. package/samples/assets/pngNoAlphaDemo.png +0 -0
  214. package/samples/assets/webpDemo.webp +0 -0
  215. package/tsconfig.json +0 -47
  216. package/utils/index.d.ts +0 -3
  217. package/utils/index.js +0 -10
@@ -1,173 +0,0 @@
1
- <!--
2
- * 【界面概述】
3
- * 展示精灵图的用法,包含动图和切图
4
- *
5
- * 【控件介绍】
6
- * JsvSpriteImg:精灵图控件
7
- * spriteInfo {object} (必需)精灵图配置信息{frames:[], meta:{}}
8
- * viewSize {object} (必需){w:0, h:0}
9
- * imageUrl {string} (必需)图片地址
10
- * duration {float} (动图必需)动图的时间
11
- * onAnimEnd {fucntion} 动图结束回调
12
- * loop {string} 动图的循环次数 infinite/数字,默认为infinite
13
- * spriteName {string} 动图的名称,默认为null
14
- * autostart{boolean} 是否自动播放动图
15
- * controller {SpriteController} 控制动图的对象
16
- * stop(end_frame) 停止动画 end_frame: "start", "end"
17
- * start() 开始动画
18
- *
19
- *
20
- * 【技巧说明】
21
- * Q: 动图和切图如何实现?
22
- * A: spriteInfo中的frame有多个时为动图,只有一个时为切图
23
- *
24
- * Q: spriteInfo中属性的含义?
25
- * A: meta.size为整张切图的大小;frames中为每一帧的位置和大小信息,目前仅支持统一大小的帧
26
- -->
27
-
28
- <script>
29
- import { SpriteController, JsvSpriteAnim } from "jsview";
30
- import spriteImage from "./images/egg_break.png";
31
- import config_json from "./images/egg_break.json";
32
- export default {
33
- components: {
34
- JsvSpriteAnim,
35
- },
36
- setup() {
37
- return {
38
- spriteImage: spriteImage,
39
- config_json: config_json,
40
- };
41
- },
42
- data() {
43
- console.log(
44
- "test spriteImage =",
45
- spriteImage,
46
- "/n config_json=",
47
- config_json
48
- );
49
- const sprite_info = this._formatInfo();
50
- console.log("test sprite_into =", sprite_info);
51
- const view_size = {
52
- w: sprite_info.maxW,
53
- h: sprite_info.maxH,
54
- };
55
- console.log("test view_size =", view_size);
56
- return {
57
- sprite_info,
58
- view_size,
59
- spriteController: new SpriteController(),
60
- show: true,
61
- };
62
- },
63
- methods: {
64
- spriteAnimEnd() {
65
- this.show = false;
66
- },
67
- onKeyDown(ev) {
68
- if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
69
- this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
70
- return true;
71
- }
72
- return true;
73
- },
74
- _formatInfo() {
75
- const info = {
76
- frames: [],
77
- meta: {
78
- size: this.config_json.meta.size,
79
- },
80
- };
81
-
82
- let frames_ref = info.frames;
83
- let max_width = 0;
84
- let max_height = 0;
85
-
86
- for (let i = 0; i < this.config_json.frames.length; i++) {
87
- const target = this.config_json.frames[i].spriteSourceSize;
88
- frames_ref.push({
89
- target,
90
- source: this.config_json.frames[i].frame,
91
- });
92
- const sprite_with = target.x + target.w;
93
- const sprite_height = target.y + target.h;
94
- if (sprite_with > max_width) {
95
- max_width = sprite_with;
96
- }
97
- if (sprite_height > max_height) {
98
- max_height = sprite_height;
99
- }
100
- }
101
- return { info, maxW: max_width, maxH: max_height };
102
- },
103
- },
104
- };
105
- </script>
106
-
107
- <template>
108
- <jsv-focus-block
109
- autoFocus
110
- :onAction="{
111
- onKeyDown: onKeyDown,
112
- }"
113
- >
114
- <div
115
- :style="{
116
- textAlign: 'center',
117
- fontSize: '30px',
118
- lineHeight: '50px',
119
- color: '#ffffff',
120
- left: 200,
121
- top: 100,
122
- width: 434,
123
- height: 50,
124
- backgroundColor: 'rgba(27,38,151,0.8)',
125
- }"
126
- >
127
- 精灵图效果
128
- </div>
129
- <!--
130
- 通过show进行 清理精灵图,用于验证精灵图清理后,StyleSheet中cssRules的keyFrame清理工作能正常完成
131
- -->
132
- <div
133
- v-if="this.show"
134
- :style="{ left: 200, top: 150, transform: 'scale3d(2.5, 2.5, 1)' }"
135
- >
136
- <JsvSpriteAnim
137
- :spriteInfo="sprite_info.info"
138
- :loop="10"
139
- :viewSize="view_size"
140
- :duration="0.8"
141
- :controller="this.spriteController"
142
- :autostart="true"
143
- :onAnimEnd="spriteAnimEnd"
144
- :imageUrl="spriteImage"
145
- />
146
- </div>
147
-
148
- <div
149
- :style="{
150
- textAlign: 'center',
151
- fontSize: '30px',
152
- lineHeight: '50px',
153
- color: '#ffffff',
154
- left: 700,
155
- top: 100,
156
- width: 434,
157
- height: 50,
158
- backgroundColor: 'rgba(27,38,151,0.8)',
159
- }"
160
- >
161
- 原始图片
162
- </div>
163
- <div
164
- :style="{
165
- left: 700,
166
- top: 150,
167
- width: 434,
168
- height: 372,
169
- backgroundImage: `url(${spriteImage})`,
170
- }"
171
- />
172
- </jsv-focus-block>
173
- </template>
@@ -1,116 +0,0 @@
1
- {"frames": [
2
-
3
- {
4
- "filename": "image_00.png",
5
- "frame": {"x":104,"y":2,"w":50,"h":64},
6
- "rotated": false,
7
- "trimmed": false,
8
- "spriteSourceSize": {"x":53,"y":43,"w":50,"h":64},
9
- "sourceSize": {"w":50,"h":64}
10
- },
11
- {
12
- "filename": "image_01.png",
13
- "frame": {"x":2,"y":2,"w":48,"h":64},
14
- "rotated": false,
15
- "trimmed": false,
16
- "spriteSourceSize": {"x":55,"y":43,"w":48,"h":64},
17
- "sourceSize": {"w":48,"h":64}
18
- },
19
- {
20
- "filename": "image_02.png",
21
- "frame": {"x":52,"y":2,"w":50,"h":64},
22
- "rotated": false,
23
- "trimmed": false,
24
- "spriteSourceSize": {"x":55,"y":43,"w":50,"h":64},
25
- "sourceSize": {"w":50,"h":64}
26
- },
27
- {
28
- "filename": "image_03.png",
29
- "frame": {"x":274,"y":2,"w":64,"h":74},
30
- "rotated": false,
31
- "trimmed": false,
32
- "spriteSourceSize": {"x":54,"y":33,"w":64,"h":74},
33
- "sourceSize": {"w":64,"h":74}
34
- },
35
- {
36
- "filename": "image_04.png",
37
- "frame": {"x":156,"y":2,"w":56,"h":72},
38
- "rotated": false,
39
- "trimmed": false,
40
- "spriteSourceSize": {"x":47,"y":44,"w":56,"h":72},
41
- "sourceSize": {"w":56,"h":72}
42
- },
43
- {
44
- "filename": "image_05.png",
45
- "frame": {"x":214,"y":2,"w":58,"h":84},
46
- "rotated": false,
47
- "trimmed": false,
48
- "spriteSourceSize": {"x":46,"y":44,"w":58,"h":84},
49
- "sourceSize": {"w":58,"h":84}
50
- },
51
- {
52
- "filename": "image_06.png",
53
- "frame": {"x":2,"y":88,"w":92,"h":106},
54
- "rotated": false,
55
- "trimmed": false,
56
- "spriteSourceSize": {"x":32,"y":32,"w":92,"h":106},
57
- "sourceSize": {"w":92,"h":106}
58
- },
59
- {
60
- "filename": "image_07.png",
61
- "frame": {"x":2,"y":228,"w":142,"h":140},
62
- "rotated": false,
63
- "trimmed": false,
64
- "spriteSourceSize": {"x":8,"y":20,"w":142,"h":140},
65
- "sourceSize": {"w":142,"h":140}
66
- },
67
- {
68
- "filename": "image_08.png",
69
- "frame": {"x":146,"y":228,"w":142,"h":140},
70
- "rotated": false,
71
- "trimmed": false,
72
- "spriteSourceSize": {"x":8,"y":20,"w":142,"h":140},
73
- "sourceSize": {"w":142,"h":140}
74
- },
75
- {
76
- "filename": "image_09.png",
77
- "frame": {"x":290,"y":228,"w":142,"h":140},
78
- "rotated": false,
79
- "trimmed": false,
80
- "spriteSourceSize": {"x":8,"y":20,"w":142,"h":140},
81
- "sourceSize": {"w":142,"h":140}
82
- },
83
- {
84
- "filename": "image_10.png",
85
- "frame": {"x":190,"y":88,"w":136,"h":138},
86
- "rotated": false,
87
- "trimmed": false,
88
- "spriteSourceSize": {"x":11,"y":21,"w":136,"h":138},
89
- "sourceSize": {"w":136,"h":138}
90
- },
91
- {
92
- "filename": "image_11.png",
93
- "frame": {"x":96,"y":88,"w":92,"h":88},
94
- "rotated": false,
95
- "trimmed": false,
96
- "spriteSourceSize": {"x":33,"y":26,"w":92,"h":88},
97
- "sourceSize": {"w":92,"h":88}
98
- },
99
- {
100
- "filename": "image_12.png",
101
- "frame": {"x":340,"y":2,"w":88,"h":84},
102
- "rotated": false,
103
- "trimmed": false,
104
- "spriteSourceSize": {"x":35,"y":26,"w":88,"h":84},
105
- "sourceSize": {"w":88,"h":84}
106
- }],
107
- "meta": {
108
- "app": "http://www.texturepacker.com",
109
- "version": "1.0",
110
- "image": "egg_1.png",
111
- "format": "RGBA8888",
112
- "size": {"w":434,"h":372},
113
- "scale": "1",
114
- "smartupdate": "$TexturePacker:SmartUpdate:3ca02d63806cac6ee77822c5f378c4f3$"
115
- }
116
- }
@@ -1,91 +0,0 @@
1
- <!--
2
- * 【界面概述】
3
- * 展示文字垂直对齐方式显示控件的用法
4
- *
5
- * 【控件介绍】
6
- *
7
- * JsvTextBox:Vue高阶组件,文字的垂直对齐方式显示控件
8
- * props说明:
9
- * verticalAlign {string} 垂直对齐方式 (必需) top、middle、bottom
10
- * style {object} 样式(必需)
11
- *
12
- * 【技巧说明】
13
- * Q: 如何实现文字居中对齐方式显示?
14
- * A: verticalAlign属性设置为middle
15
- *
16
- * Q: 如何触发控件重绘?
17
- * A: 1. 变更文字内容,将触发控件重绘,但不会重新解析styles
18
- -->
19
-
20
- <script setup>
21
- import RenderLeft from "./RenderLeft.vue";
22
- import RenderRight from "./RenderRight.vue";
23
- import RenderCenter from "./RenderCenter.vue";
24
- import RenderOneLine from "./RenderOneLine.vue";
25
- import { ref, shallowRef } from "vue";
26
- import { useRouter } from "vue-router";
27
-
28
- const router = useRouter();
29
- let offsetX = ref(0);
30
- let offsetY = ref(0);
31
- const onLineText = "abcdefghigk";
32
- const text = `静夜思 --唐李白
33
- 床前明月光,疑是地上霜;
34
- 举头望明月,低头思故乡。`;
35
- const text_latex = `静夜思 --唐李白
36
- 床前\\textcolor{#FF0000}{明月光},疑是地上霜;
37
- 举头\\textcolor{#0000FF}{望明月},低头思故乡。`;
38
-
39
- const moveCount = ref(0);
40
-
41
- const onKeyDown = (ev) => {
42
- if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
43
- router.go(-1); // 有router时,是从DemoHomepage进入,回退
44
- return true;
45
- }
46
- switch (ev.keyCode) {
47
- case 37:
48
- offsetX.value += 30;
49
- moveCount.value++;
50
- break;
51
- case 39:
52
- offsetX.value -= 30;
53
- moveCount.value++;
54
- break;
55
- case 38:
56
- offsetY.value += 30;
57
- moveCount.value++;
58
- break;
59
- case 40:
60
- offsetY.value -= 30;
61
- moveCount.value++;
62
- break;
63
- }
64
- return true;
65
- };
66
- const onFocus = () => {
67
- console.log("TextBox getFocus");
68
- };
69
- const onBlur = () => {
70
- console.log("TextBox loseFocus");
71
- };
72
- </script>
73
-
74
- <template>
75
- <jsv-focus-block
76
- autoFocus
77
- :onAction="{
78
- onKeyDown: onKeyDown,
79
- onFocus: onFocus,
80
- onBlur: onBlur,
81
- }"
82
- >
83
- <div :style="{width:1280, height:720, backgroundColor:'#000000'}"/>
84
- <div :style="{ top: offsetY, left: offsetX }">
85
- <RenderLeft :text="text" :moveCount="moveCount" />
86
- <RenderRight :text="text" />
87
- <RenderCenter :text="text" :text_latex="text_latex" />
88
- <RenderOneLine :text="onLineText" />
89
- </div>
90
- </jsv-focus-block>
91
- </template>
@@ -1,133 +0,0 @@
1
- <script>
2
- import { JsvTextBox } from "jsview";
3
- export default {
4
- props: {
5
- text: String,
6
- text_latex: String,
7
- },
8
- components: { JsvTextBox },
9
- };
10
- </script>
11
-
12
- <template>
13
- <div :style="{ top: 400 }">
14
- <div
15
- :style="{
16
- left: 0,
17
- top: -50,
18
- width: 400,
19
- height: 50,
20
- fontSize: '20px',
21
- textAlign: 'left',
22
- lineHeight: '50px',
23
- backgroundColor: '#00ff00',
24
- }"
25
- >
26
- 整体垂直向上对齐、文字水平居中显示
27
- </div>
28
- <JsvTextBox
29
- :verticalAlign="'top'"
30
- :style="{
31
- left: 0,
32
- top: 0,
33
- width: 400,
34
- height: 300,
35
- backgroundColor: 'rgba(255,255,0,0.5)',
36
- fontSize: '30px',
37
- textAlign: 'center',
38
- lineHeight: '40px',
39
- }"
40
- >
41
- {{ `[TC]${text}` }}
42
- </JsvTextBox>
43
- <div
44
- :style="{
45
- left: 410,
46
- top: -50,
47
- width: 400,
48
- height: 50,
49
- fontSize: '20px',
50
- textAlign: 'left',
51
- lineHeight: '50px',
52
- backgroundColor: '#00ff00',
53
- }"
54
- >
55
- 整体垂直居中对齐、文字水平居中显示
56
- </div>
57
- <JsvTextBox
58
- :verticalAlign="'middle'"
59
- :style="{
60
- left: 410,
61
- top: 0,
62
- width: 400,
63
- height: 300,
64
- backgroundColor: 'rgba(255,255,0,0.5)',
65
- fontSize: '30px',
66
- textAlign: 'center',
67
- lineHeight: '40px',
68
- }"
69
- :enableLatex="true"
70
- >
71
- {{ `[MC]${text_latex}` }}
72
- </JsvTextBox>
73
- <div
74
- :style="{
75
- left: 820,
76
- top: -50,
77
- width: 400,
78
- height: 50,
79
- fontSize: '20px',
80
- textAlign: 'left',
81
- lineHeight: '50px',
82
- backgroundColor: '#00ff00',
83
- }"
84
- >
85
- 整体垂直向下对齐、文字水平居中显示
86
- </div>
87
- <JsvTextBox
88
- :verticalAlign="'bottom'"
89
- :style="{
90
- left: 820,
91
- top: 0,
92
- width: 400,
93
- height: 300,
94
- backgroundColor: 'rgba(255,255,0,0.5)',
95
- fontSize: '30px',
96
- textAlign: 'center',
97
- lineHeight: '40px',
98
- }"
99
- >
100
- {{ `[BC]${text}` }}
101
- </JsvTextBox>
102
-
103
- <div
104
- :style="{
105
- left: 1240,
106
- top: -50,
107
- width: 500,
108
- height: 50,
109
- fontSize: '20px',
110
- textAlign: 'left',
111
- lineHeight: '50px',
112
- backgroundColor: '#00ff00',
113
- }"
114
- >
115
- 整体垂直居中对齐、文字水平居中显示、行高80px
116
- </div>
117
- <JsvTextBox
118
- :verticalAlign="'middle'"
119
- :style="{
120
- left: 1240,
121
- top: 0,
122
- width: 500,
123
- height: 300,
124
- backgroundColor: 'rgba(255,255,0,0.5)',
125
- fontSize: '30px',
126
- textAlign: 'center',
127
- lineHeight: '80px',
128
- }"
129
- >
130
- {{ `[MC]${text}` }}
131
- </JsvTextBox>
132
- </div>
133
- </template>
@@ -1,138 +0,0 @@
1
- <script>
2
- import { JsvTextBox } from "jsview";
3
- export default {
4
- props: {
5
- text: String,
6
- moveCount: Number,
7
- },
8
- components: { JsvTextBox },
9
- };
10
- </script>
11
-
12
- <template>
13
- <div :style="{ top: 50 }">
14
- <div
15
- :style="{
16
- left: 0,
17
- top: -50,
18
- width: 400,
19
- height: 50,
20
- fontSize: '20px',
21
- textAlign: 'left',
22
- lineHeight: '50px',
23
- backgroundColor: '#00ff00',
24
- }"
25
- >
26
- 整体向上对齐、文字居左显示
27
- </div>
28
- <JsvTextBox
29
- :verticalAlign="'top'"
30
- :style="{
31
- left: 0,
32
- top: 0,
33
- width: 400,
34
- height: 300,
35
- backgroundColor: 'rgba(255,255,0,0.5)',
36
- fontSize: '30px',
37
- textAlign: 'left',
38
- lineHeight: '40px',
39
- }"
40
- >
41
- {{ `测试文字变化能引起刷新: [${moveCount}]\n[TL]${text}` }}
42
- </JsvTextBox>
43
- <div
44
- :style="{
45
- left: 410,
46
- top: -50,
47
- width: 400,
48
- height: 50,
49
- fontSize: '20px',
50
- textAlign: 'left',
51
- lineHeight: '50px',
52
- backgroundColor: '#00ff00',
53
- }"
54
- >
55
- 整体垂直居中对齐、文字水平居左显示
56
- </div>
57
- <JsvTextBox
58
- :verticalAlign="'middle'"
59
- :style="{
60
- left: 410,
61
- top: 0,
62
- width: 400,
63
- height: 300,
64
- backgroundColor: 'rgba(255,255,0,0.5)',
65
- fontSize: '30px',
66
- textAlign: 'left',
67
- lineHeight: '40px',
68
- }"
69
- >
70
- {{ `[ML]${text}` }}
71
- </JsvTextBox>
72
- <div
73
- :style="{
74
- left: 820,
75
- top: -50,
76
- width: 400,
77
- height: 50,
78
- fontSize: '20px',
79
- textAlign: 'left',
80
- lineHeight: '50px',
81
- backgroundColor: '#00ff00',
82
- }"
83
- >
84
- 整体垂直向下对齐、文字水平居左显示
85
- </div>
86
- <JsvTextBox
87
- :verticalAlign="'bottom'"
88
- :style="{
89
- left: 820,
90
- top: 0,
91
- width: 400,
92
- height: 300,
93
- backgroundColor: 'rgba(255,255,0,0.5)',
94
- fontSize: '30px',
95
- textAlign: 'left',
96
- lineHeight: '40px',
97
- }"
98
- >
99
- {{ `[BL]${text}` }}
100
- </JsvTextBox>
101
- <div
102
- :style="{
103
- left: 1240,
104
- top: -50,
105
- width: 500,
106
- height: 50,
107
- fontSize: '20px',
108
- textAlign: 'left',
109
- lineHeight: '50px',
110
- backgroundColor: '#00ff00',
111
- }"
112
- >
113
- 整体垂直向上对齐、文字水平居左显示、行高80px
114
- </div>
115
- <JsvTextBox
116
- :verticalAlign="'top'"
117
- :style="{
118
- left: 1240,
119
- top: 0,
120
- width: 500,
121
- height: 300,
122
- backgroundColor: 'rgba(255,255,0,0.5)',
123
- fontSize: '30px',
124
- textAlign: 'left',
125
- lineHeight: '80px',
126
- }"
127
- className="test"
128
- >
129
- {{ `[TL]${text}` }}
130
- </JsvTextBox>
131
- </div>
132
- </template>
133
-
134
- <style scoped>
135
- .test {
136
- color: #007788
137
- }
138
- </style>