@shijiu/jsview-vue 0.9.490 → 0.9.590

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 (220) hide show
  1. package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
  2. package/dom/bin/jsview-dom.min.js +1 -1
  3. package/dom/target_core_revision.js +4 -3
  4. package/index.js +10 -0
  5. package/package.json +8 -1
  6. package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +20 -6
  7. package/samples/AnimPicture/App.vue +89 -106
  8. package/samples/Basic/App.vue +65 -68
  9. package/samples/Basic/components/ContentBlock.vue +31 -36
  10. package/samples/Basic/components/anim/AnimGroup.vue +61 -75
  11. package/samples/Basic/components/anim/AnimKeyframeBasic.vue +54 -43
  12. package/samples/Basic/components/anim/AnimKeyframeComposite.vue +25 -31
  13. package/samples/Basic/components/anim/AnimTransition.vue +142 -105
  14. package/samples/Basic/components/div/DivBackground.vue +38 -16
  15. package/samples/Basic/components/div/DivClip.vue +143 -78
  16. package/samples/Basic/components/div/DivCssScoped.vue +10 -10
  17. package/samples/Basic/components/div/DivCssVar.vue +40 -42
  18. package/samples/Basic/components/div/DivGroup1.vue +45 -39
  19. package/samples/Basic/components/div/DivGroup2.vue +56 -45
  20. package/samples/Basic/components/div/DivLayout.vue +34 -5
  21. package/samples/Basic/components/div/DivRadius.vue +51 -42
  22. package/samples/Basic/components/div/DivTransform.vue +21 -16
  23. package/samples/Basic/components/panel/Panel1.vue +46 -44
  24. package/samples/Basic/components/panel/Panel2.vue +22 -26
  25. package/samples/Basic/components/panel/TitleBar.vue +12 -12
  26. package/samples/Basic/components/text/TextAlign.vue +54 -44
  27. package/samples/Basic/components/text/TextEmoji.vue +16 -20
  28. package/samples/Basic/components/text/TextFontStyle.vue +77 -53
  29. package/samples/Basic/components/text/TextGroup1.vue +46 -38
  30. package/samples/Basic/components/text/TextGroup2.vue +25 -28
  31. package/samples/Basic/components/text/TextOverflow.vue +76 -57
  32. package/samples/BasicFocusControl/App.vue +22 -43
  33. package/samples/BasicFocusControl/components/BaseBlock.vue +42 -43
  34. package/samples/BasicFocusControl/components/MainArea.vue +55 -70
  35. package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +11 -15
  36. package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +21 -24
  37. package/samples/BasicFocusControl/components/SideBar.vue +32 -47
  38. package/samples/BasicFocusControl/components/SideBarBlock.vue +20 -23
  39. package/samples/ColorSpace/App.vue +15 -24
  40. package/samples/DemoHomepage/App.vue +7 -11
  41. package/samples/DemoHomepage/components/BodyFrame.vue +19 -9
  42. package/samples/DemoHomepage/components/TabFrame.vue +7 -8
  43. package/samples/DemoHomepage/router.js +33 -34
  44. package/samples/DemoHomepage/views/Homepage.vue +24 -8
  45. package/samples/FilterDemo/AnimatePic.vue +58 -0
  46. package/samples/FilterDemo/App.vue +99 -61
  47. package/samples/FilterDemo/VideoLayer.vue +62 -0
  48. package/samples/FlipCard/App.vue +32 -41
  49. package/samples/FlipCard/FlipCard.vue +48 -54
  50. package/samples/GridDemo/App.vue +109 -77
  51. package/samples/GridDemo/ButtonBlock.vue +50 -49
  52. package/samples/GridDemo/FocusItem.vue +19 -38
  53. package/samples/GridDemo/Item.vue +46 -54
  54. package/samples/HashHistory/App.vue +63 -79
  55. package/samples/HashHistory/components/HorizontalButtonList.vue +72 -95
  56. package/samples/HashHistory/components/Item.vue +42 -56
  57. package/samples/HashHistory/router.js +23 -12
  58. package/samples/HashHistory/views/MainPage.vue +35 -46
  59. package/samples/HashHistory/views/SubPage.vue +34 -47
  60. package/samples/Input/App.vue +2 -3
  61. package/samples/Input/FullKeyboard.vue +2 -6
  62. package/samples/Input/InputPanel.vue +2 -3
  63. package/samples/Input/KeyboardItem.vue +1 -1
  64. package/samples/LongImage/App.vue +11 -27
  65. package/samples/LongImage/Button.vue +50 -145
  66. package/samples/LongImage/ButtonItem.vue +44 -0
  67. package/samples/LongImage/LongImageScroll.vue +71 -106
  68. package/samples/LongImage/Scroll.vue +7 -9
  69. package/samples/LongText/App.vue +13 -28
  70. package/samples/LongText/Button.vue +43 -145
  71. package/samples/LongText/ButtonItem.vue +44 -0
  72. package/samples/LongText/LongTextScroll.vue +68 -101
  73. package/samples/LongText/Scroll.vue +7 -9
  74. package/samples/Marquee/App.vue +34 -37
  75. package/samples/MaskClip/App.vue +17 -30
  76. package/samples/MetroWidgetDemos/Advanced/App.vue +211 -0
  77. package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
  78. package/samples/MetroWidgetDemos/Item.vue +67 -0
  79. package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/App.vue +80 -104
  80. package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/Item.vue +7 -0
  81. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/bg.jpg +0 -0
  82. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_content.png +0 -0
  83. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_left.png +0 -0
  84. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_mid.png +0 -0
  85. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_right.png +0 -0
  86. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/focus_border.png +0 -0
  87. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/holder_logo.png +0 -0
  88. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/jrbm.png +0 -0
  89. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_left.png +0 -0
  90. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_mid.png +0 -0
  91. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_right.png +0 -0
  92. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/loading.png +0 -0
  93. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/logo.png +0 -0
  94. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/mcjx.png +0 -0
  95. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/tao.png +0 -0
  96. package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/tmall.png +0 -0
  97. package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/border.png +0 -0
  98. package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/components/ContentItem.vue +60 -86
  99. package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/components/MyTab.vue +0 -0
  100. package/samples/MetroWidgetDemos/PerformanceTest/data.js +45 -0
  101. package/samples/MetroWidgetDemos/PingPong/App.vue +135 -0
  102. package/samples/MetroWidgetDemos/PingPong/AppPage.vue +58 -0
  103. package/samples/MetroWidgetDemos/PingPong/AppTab.vue +69 -0
  104. package/samples/MetroWidgetDemos/PingPong/Item.vue +92 -0
  105. package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
  106. package/samples/MetroWidgetDemos/Simple/App.vue +194 -0
  107. package/samples/MetroWidgetDemos/WidgetItem.vue +89 -0
  108. package/samples/MetroWidgetDemos/data.js +204 -0
  109. package/samples/NinePatchDemo/App.vue +114 -115
  110. package/samples/NinePatchDemo/Item.vue +7 -8
  111. package/samples/NinePatchDemo/assets/border.png +0 -0
  112. package/samples/Preload/App.vue +61 -63
  113. package/samples/Preload/Item.vue +21 -29
  114. package/samples/QrcodeDemo/App.vue +24 -29
  115. package/samples/SoundPool/App.vue +77 -106
  116. package/samples/SprayView/App.vue +10 -8
  117. package/samples/SpriteImage/App.vue +1 -2
  118. package/samples/TextBox/App.vue +86 -101
  119. package/samples/TextBox/RenderCenter.vue +1 -1
  120. package/samples/TextBox/RenderLeft.vue +1 -1
  121. package/samples/TextBox/RenderOneLine.vue +1 -1
  122. package/samples/TextBox/RenderRight.vue +1 -1
  123. package/samples/TextShadowDemo/App.vue +1 -2
  124. package/samples/TextureAnimation/App.vue +16 -13
  125. package/samples/TextureSize/App.vue +15 -25
  126. package/samples/ThrowMoveDemo/AccelerateDemo.vue +2 -4
  127. package/samples/ThrowMoveDemo/LRParabolicDemo.vue +2 -3
  128. package/samples/ThrowMoveDemo/TargetDemo.vue +3 -4
  129. package/samples/ThrowMoveDemo/UDParabolicDemo.vue +2 -3
  130. package/samples/TouchSample/App.vue +2 -3
  131. package/samples/TouchSample/Item.vue +15 -13
  132. package/samples/TouchSample/MetroWidgetHorizontal.vue +2 -2
  133. package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
  134. package/samples/TouchSample/TouchContainerHorizontal.vue +4 -3
  135. package/samples/TouchSample/TouchContainerVertical.vue +3 -2
  136. package/samples/TransitPage/App.vue +20 -32
  137. package/samples/VideoDemo/App.vue +65 -81
  138. package/samples/VideoDemo/components/Button.vue +41 -52
  139. package/samples/VideoDemo/components/Controllor.vue +171 -169
  140. package/samples/VideoDemo/components/VideoFrame.vue +87 -99
  141. package/samples/VisibleSensorDemo/App.vue +167 -0
  142. package/scripts/jsview-jsmap-serve.js +42 -0
  143. package/scripts/jsview-post-build.js +6 -1
  144. package/scripts/jsview-post-install.js +1 -1
  145. package/tsconfig.json +3 -0
  146. package/utils/JsViewEngineWidget/JsvFocusBlock.vue +204 -193
  147. package/utils/JsViewEngineWidget/JsvFocusManager.js +30 -17
  148. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +1557 -1656
  149. package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.js +136 -0
  150. package/utils/JsViewEngineWidget/MetroWidget/ToolFunctions.js +18 -0
  151. package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +2 -0
  152. package/utils/JsViewEngineWidget/TemplateParser.js +111 -1
  153. package/utils/JsViewEngineWidget/WidgetCommon.js +8 -2
  154. package/utils/JsViewEngineWidget/index.js +4 -4
  155. package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +1 -1
  156. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +284 -57
  157. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +5 -1
  158. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +25 -12
  159. package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
  160. package/utils/JsViewVueTools/JsvRefTaker.js +35 -0
  161. package/utils/JsViewVueTools/index.js +19 -0
  162. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +25 -10
  163. package/utils/JsViewVueWidget/BrowserDebugWidget/JsvApic/BrowserApic.vue +1 -1
  164. package/utils/JsViewVueWidget/JsvFilterView.vue +59 -51
  165. package/utils/JsViewVueWidget/JsvGrid.vue +140 -42
  166. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +3 -1
  167. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +8 -17
  168. package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -1
  169. package/utils/JsViewVueWidget/JsvPosterDiv.vue +37 -7
  170. package/utils/JsViewVueWidget/JsvPosterImage.vue +34 -13
  171. package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +2 -12
  172. package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +13 -4
  173. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +13 -10
  174. package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -3
  175. package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +25 -21
  176. package/utils/JsViewVueWidget/JsvTransparentDiv.vue +7 -8
  177. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +141 -0
  178. package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +9 -0
  179. package/utils/JsViewVueWidget/index.js +42 -0
  180. package/samples/AdvanceMetroWidget/App.vue +0 -123
  181. package/samples/AdvanceMetroWidget/Frame.vue +0 -102
  182. package/samples/AdvanceMetroWidget/Item.vue +0 -63
  183. package/samples/AdvanceMetroWidget/data.js +0 -137
  184. package/samples/ClassNameDemo/App.vue +0 -119
  185. package/samples/ClassNameDemo/components/ContentItem.vue +0 -253
  186. package/samples/ClassNameDemo/components/LoadingView.vue +0 -43
  187. package/samples/ClassNameDemo/components/TitleView.vue +0 -24
  188. package/samples/ClassNameDemo/data.js +0 -24
  189. package/samples/FlowMultiWidget/App.vue +0 -91
  190. package/samples/FlowMultiWidget/assets/nine_patch_focus.png +0 -0
  191. package/samples/FlowMultiWidget/components/Block.vue +0 -107
  192. package/samples/FlowMultiWidget/components/FlowPage.vue +0 -60
  193. package/samples/FlowMultiWidget/components/Item.vue +0 -103
  194. package/samples/FlowMultiWidget/components/MenuItem.vue +0 -72
  195. package/samples/FlowMultiWidget/components/MyMenu.vue +0 -90
  196. package/samples/FlowMultiWidget/data.js +0 -446
  197. package/samples/HashHistory/views/BasePage.vue +0 -19
  198. package/samples/HashHistory/views/SubPageFirst.vue +0 -10
  199. package/samples/HashHistory/views/SubPageSecond.vue +0 -10
  200. package/samples/SimpleWidgetDemo/assets/bg.jpg +0 -0
  201. package/samples/SimpleWidgetDemo/assets/coupon_content.png +0 -0
  202. package/samples/SimpleWidgetDemo/assets/coupon_left.png +0 -0
  203. package/samples/SimpleWidgetDemo/assets/coupon_mid.png +0 -0
  204. package/samples/SimpleWidgetDemo/assets/coupon_right.png +0 -0
  205. package/samples/SimpleWidgetDemo/assets/focus_border.png +0 -0
  206. package/samples/SimpleWidgetDemo/assets/holder_logo.png +0 -0
  207. package/samples/SimpleWidgetDemo/assets/jrbm.png +0 -0
  208. package/samples/SimpleWidgetDemo/assets/line_left.png +0 -0
  209. package/samples/SimpleWidgetDemo/assets/line_mid.png +0 -0
  210. package/samples/SimpleWidgetDemo/assets/line_right.png +0 -0
  211. package/samples/SimpleWidgetDemo/assets/loading.png +0 -0
  212. package/samples/SimpleWidgetDemo/assets/logo.png +0 -0
  213. package/samples/SimpleWidgetDemo/assets/mcjx.png +0 -0
  214. package/samples/SimpleWidgetDemo/assets/tao.png +0 -0
  215. package/samples/SimpleWidgetDemo/assets/tmall.png +0 -0
  216. package/samples/SimpleWidgetDemo/data.js +0 -124
  217. package/utils/JsViewEngineWidget/MetroWidget/ContentView.vue +0 -63
  218. package/utils/JsViewEngineWidget/MetroWidget/DivWrapper.vue +0 -51
  219. package/utils/JsViewEngineWidget/MetroWidget/ItemView.vue +0 -213
  220. package/utils/JsViewEngineWidget/MetroWidget/RootView.vue +0 -154
@@ -1,94 +1,159 @@
1
+ <script setup>
2
+ import testImgPath from "../../assets/test.jpg";
3
+
4
+ const titleHeight = 16;
5
+ const imageSize = {
6
+ width: 80,
7
+ height: 64,
8
+ };
9
+
10
+ const clipSize = {
11
+ width: 50,
12
+ height: 40,
13
+ };
14
+ </script>
15
+
1
16
  <template>
2
- <div id='layout-root'>
3
- <div style="{top: 0}">
4
- <div class="content-font" :style="{width: 50, height: titleHeight}">原图</div>
5
- <div :style="{top: titleHeight,
6
- width: imageSize.width+4, height: imageSize.height+4,
7
- backgroundColor: 'rgba(0, 255, 0, 1)' }">
8
- <div :style="{ left: 2, top: 2,
9
- width: imageSize.width, height: imageSize.height,
10
- backgroundImage: `url(${testImgPath})` }"/>
11
- </div>
17
+ <div id="layout-root">
18
+ <div
19
+ style="
20
+ {
21
+ top: 0;
22
+ }
23
+ "
24
+ >
25
+ <div class="content-font" :style="{ width: 50, height: titleHeight }">
26
+ 原图
27
+ </div>
28
+ <div
29
+ :style="{
30
+ top: titleHeight,
31
+ width: imageSize.width + 4,
32
+ height: imageSize.height + 4,
33
+ backgroundColor: 'rgba(0, 255, 0, 1)',
34
+ }"
35
+ >
36
+ <div
37
+ :style="{
38
+ left: 2,
39
+ top: 2,
40
+ width: imageSize.width,
41
+ height: imageSize.height,
42
+ backgroundImage: `url(${testImgPath})`,
43
+ }"
44
+ />
45
+ </div>
12
46
  </div>
13
47
 
14
- <div :style="{top: imageSize.height+titleHeight+4}">
15
- <div class="content-font" :style="{ width: 120, height: titleHeight }">左上Overflow</div>
16
- <div :style="{ top: titleHeight,
17
- width: imageSize.width+4, height: imageSize.height+4,
18
- backgroundColor: 'rgba(0, 255, 0, 1)' }">
19
- <div key="clipArea" :style="{ left: 2, top: 2,
20
- width: clipSize.width, height: clipSize.height,
21
- overflow: 'hidden' }">
22
- <div :style="{ width: imageSize.width,
23
- height: imageSize.height,
24
- backgroundImage: `url(${testImgPath})` }"/>
25
- </div>
48
+ <div :style="{ top: imageSize.height + titleHeight + 4 }">
49
+ <div class="content-font" :style="{ width: 120, height: titleHeight }">
50
+ 左上Overflow
51
+ </div>
52
+ <div
53
+ :style="{
54
+ top: titleHeight,
55
+ width: imageSize.width + 4,
56
+ height: imageSize.height + 4,
57
+ backgroundColor: 'rgba(0, 255, 0, 1)',
58
+ }"
59
+ >
60
+ <div
61
+ key="clipArea"
62
+ :style="{
63
+ left: 2,
64
+ top: 2,
65
+ width: clipSize.width,
66
+ height: clipSize.height,
67
+ overflow: 'hidden',
68
+ }"
69
+ >
70
+ <div
71
+ :style="{
72
+ width: imageSize.width,
73
+ height: imageSize.height,
74
+ backgroundImage: `url(${testImgPath})`,
75
+ }"
76
+ />
26
77
  </div>
78
+ </div>
27
79
  </div>
28
80
 
29
- <div :style="{ top: (imageSize.height+titleHeight+4)*2 }">
30
- <div class="content-font" :style="{ width: 120, height: titleHeight }">右下Overflow</div>
31
- <div :style="{ top: titleHeight,
32
- width: imageSize.width+4, height: imageSize.height+4,
33
- backgroundColor: 'rgba(0, 255, 0, 1)' }">
34
- <div key="clipArea" :style="{ top: 2+(imageSize.height-clipSize.height),
35
- left: 2+(imageSize.width-clipSize.width),
36
- width: clipSize.width, height: clipSize.height,
37
- overflow: 'hidden' }">
38
- <div :style="{ top: -((imageSize.height-clipSize.height)),
39
- left: -(imageSize.width-clipSize.width),
40
- width: imageSize.width, height: imageSize.height,
41
- backgroundImage: `url(${testImgPath})` }"/>
42
- </div>
81
+ <div :style="{ top: (imageSize.height + titleHeight + 4) * 2 }">
82
+ <div class="content-font" :style="{ width: 120, height: titleHeight }">
83
+ 右下Overflow
84
+ </div>
85
+ <div
86
+ :style="{
87
+ top: titleHeight,
88
+ width: imageSize.width + 4,
89
+ height: imageSize.height + 4,
90
+ backgroundColor: 'rgba(0, 255, 0, 1)',
91
+ }"
92
+ >
93
+ <div
94
+ key="clipArea"
95
+ :style="{
96
+ top: 2 + (imageSize.height - clipSize.height),
97
+ left: 2 + (imageSize.width - clipSize.width),
98
+ width: clipSize.width,
99
+ height: clipSize.height,
100
+ overflow: 'hidden',
101
+ }"
102
+ >
103
+ <div
104
+ :style="{
105
+ top: -(imageSize.height - clipSize.height),
106
+ left: -(imageSize.width - clipSize.width),
107
+ width: imageSize.width,
108
+ height: imageSize.height,
109
+ backgroundImage: `url(${testImgPath})`,
110
+ }"
111
+ />
43
112
  </div>
113
+ </div>
44
114
  </div>
45
115
 
46
- <div :style="{ top: imageSize.height+titleHeight+4, left: imageSize.width+16 }">
47
- <div class="content-font" :style="{ width: 100, height: titleHeight }">ClipPath</div>
48
- <div :style="{ top: titleHeight,
49
- width: imageSize.width+4, height: imageSize.height+4,
50
- backgroundColor: 'rgba(0, 255, 0, 1)' }">
51
- <div key="clipArea" :style="{ left: 2, top: 2,
52
- width: imageSize.width, height: imageSize.height,
53
- clipPath: 'inset(5px 10px 15px 20px)'/* margin of top, right, bottom, left */ }">
54
- <div :style="{ width: imageSize.width, height: imageSize.height,
55
- backgroundImage: `url(${testImgPath})` }"/>
56
- </div>
116
+ <div
117
+ :style="{
118
+ top: imageSize.height + titleHeight + 4,
119
+ left: imageSize.width + 16,
120
+ }"
121
+ >
122
+ <div class="content-font" :style="{ width: 100, height: titleHeight }">
123
+ ClipPath
124
+ </div>
125
+ <div
126
+ :style="{
127
+ top: titleHeight,
128
+ width: imageSize.width + 4,
129
+ height: imageSize.height + 4,
130
+ backgroundColor: 'rgba(0, 255, 0, 1)',
131
+ }"
132
+ >
133
+ <div
134
+ key="clipArea"
135
+ :style="{
136
+ left: 2,
137
+ top: 2,
138
+ width: imageSize.width,
139
+ height: imageSize.height,
140
+ clipPath:
141
+ 'inset(5px 10px 15px 20px)' /* margin of top, right, bottom, left */,
142
+ }"
143
+ >
144
+ <div
145
+ :style="{
146
+ width: imageSize.width,
147
+ height: imageSize.height,
148
+ backgroundImage: `url(${testImgPath})`,
149
+ }"
150
+ />
57
151
  </div>
152
+ </div>
58
153
  </div>
59
-
60
- </div>
154
+ </div>
61
155
  </template>
62
156
 
63
- <script>
64
- import testImgPath from '../../assets/test.jpg';
65
-
66
- export default {
67
- computed: {
68
- testImgPath() {
69
- return testImgPath;
70
- },
71
- titleHeight() {
72
- return 16;
73
- },
74
- imageSize() {
75
- return {
76
- width: 80,
77
- height: 64,
78
- }
79
- },
80
- clipSize() {
81
- return {
82
- width: 50,
83
- height: 40,
84
- }
85
- }
86
- }
87
- }
88
-
89
- </script>
90
-
91
-
92
157
  <style>
93
158
  @import "../FontStyle.css";
94
159
  </style>
@@ -1,20 +1,20 @@
1
+ <script setup>
2
+ defineProps({
3
+ jsvclass: String,
4
+ });
5
+ </script>
6
+
1
7
  <template>
2
- <div>
3
8
  <div>
4
- <div :class="jsvclass" jsv-inherit-class="2">
9
+ <div>
10
+ <div :class="jsvclass" jsv-inherit-class="2">
5
11
  Scoped CSS穿透, 此处的属性是Container设进来的.
12
+ </div>
6
13
  </div>
7
14
  </div>
8
- </div>
9
15
  </template>
10
16
 
11
- <script>
12
- export default {
13
- props: {
14
- jsvclass: String,
15
- },
16
- }
17
- </script>
17
+
18
18
 
19
19
  <style scoped>
20
20
  </style>
@@ -1,49 +1,47 @@
1
+ <script setup>
2
+ import { reactive, onMounted, onBeforeUnmount } from "vue";
3
+ let timerId = -1;
4
+ let state = reactive({
5
+ foreColor: "#FF0000",
6
+ backColor: "#00FF00",
7
+ });
8
+ onMounted(() => {
9
+ timerId = setInterval(() => {
10
+ if (state.foreColor == "#00FF00") {
11
+ state.foreColor = "#FF0000";
12
+ state.backColor = "#00FF00";
13
+ } else {
14
+ state.foreColor = "#00FF00";
15
+ state.backColor = "#FF0000";
16
+ }
17
+ }, 3000);
18
+ });
19
+ onBeforeUnmount(() => {
20
+ {
21
+ if (timerId >= 0) {
22
+ clearInterval(timerId);
23
+ }
24
+ timerId = -1;
25
+ }
26
+ });
27
+ </script>
28
+
1
29
  <template>
2
- <div class="block">
3
- 顶级元素的CSS class中包含变量 (不推荐)
4
- </div>
30
+ <div class="block">顶级元素的CSS class中包含变量 (不推荐)</div>
5
31
 
6
- <div :style="{left: 70, width: 65, height: 65,
7
- color: state.foreColor,
8
- backgroundColor: state.backColor}">
9
- 子级元素CSS class中包含变量
10
- </div>
32
+ <div
33
+ :style="{
34
+ left: 70,
35
+ width: 65,
36
+ height: 65,
37
+ color: state.foreColor,
38
+ backgroundColor: state.backColor,
39
+ }"
40
+ >
41
+ 子级元素CSS class中包含变量
42
+ </div>
11
43
  </template>
12
44
 
13
- <script>
14
- import { reactive } from "vue";
15
-
16
- export default {
17
- data() {
18
- return {
19
- timerId: -1,
20
- state: reactive({
21
- foreColor: '#FF0000',
22
- backColor: '#00FF00',
23
- }),
24
- }
25
- },
26
- mounted() {
27
- this.timerId = setInterval(() => {
28
- if(this.state.foreColor == '#00FF00') {
29
- this.state.foreColor = '#FF0000'
30
- this.state.backColor = '#00FF00'
31
- } else {
32
- this.state.foreColor = '#00FF00'
33
- this.state.backColor = '#FF0000'
34
- }
35
- }, 3000);
36
- },
37
- beforeUnmount() {
38
- if (this.timerId >= 0) {
39
- window.clearInterval(this.timerId);
40
- }
41
- this.timerId = -1;
42
- }
43
- }
44
-
45
- </script>
46
-
47
45
  <style scoped>
48
46
  .block {
49
47
  width: 65;
@@ -1,41 +1,47 @@
1
- <template>
2
- <div id='item-root'>
3
- <ContentBlock :class=contentClass :style="{top:itemSides.height*0}" :=contentBlockProps :index=0 title="Layout(布局定位)">
4
- <DivLayout/>
5
- </ContentBlock>
6
- <ContentBlock :class=contentClass :style="{top:itemSides.height*1}" :=contentBlockProps :index=1 title="Background(加载图片)">
7
- <DivBackground/>
8
- </ContentBlock>
9
- <ContentBlock :class=contentClass :style="{top:itemSides.height*2}" :="{...contentBlockProps, itemSides: {...itemSides, height:290}}" :index=2 title="Clip(裁剪)">
10
- <DivClip/>
11
- </ContentBlock>
12
- </div>
13
- </template>
1
+ <script setup>
2
+ import ContentBlock from "../ContentBlock";
3
+ import DivBackground from "./DivBackground";
4
+ import DivClip from "./DivClip";
5
+ import DivLayout from "./DivLayout";
14
6
 
15
- <script>
16
- import ContentBlock from '../ContentBlock';
17
- import DivBackground from './DivBackground';
18
- import DivClip from './DivClip';
19
- import DivLayout from './DivLayout';
7
+ const props = defineProps({
8
+ contentClass: String,
9
+ itemSides: Object,
10
+ });
11
+ const contentBlockProps = {
12
+ colIndex: 0,
13
+ itemSides: props.itemSides,
14
+ };
15
+ </script>
20
16
 
21
- export default {
22
- props: {
23
- contentClass: String,
24
- itemSides: Object
25
- },
26
- components: {
27
- ContentBlock,
28
- DivBackground,
29
- DivClip,
30
- DivLayout,
31
- },
32
- computed: {
33
- contentBlockProps() {
34
- return {
35
- colIndex: 0,
36
- itemSides: this.itemSides
37
- }
38
- }
39
- }
40
- }
41
- </script>
17
+ <template>
18
+ <div id="item-root">
19
+ <ContentBlock
20
+ :class="contentClass"
21
+ :style="{ top: itemSides.height * 0 }"
22
+ :="contentBlockProps"
23
+ :index="0"
24
+ title="Layout(布局定位)"
25
+ >
26
+ <DivLayout />
27
+ </ContentBlock>
28
+ <ContentBlock
29
+ :class="contentClass"
30
+ :style="{ top: itemSides.height * 1 }"
31
+ :="contentBlockProps"
32
+ :index="1"
33
+ title="Background(加载图片)"
34
+ >
35
+ <DivBackground />
36
+ </ContentBlock>
37
+ <ContentBlock
38
+ :class="contentClass"
39
+ :style="{ top: itemSides.height * 2 }"
40
+ :="{ ...contentBlockProps, itemSides: { ...itemSides, height: 290 } }"
41
+ :index="2"
42
+ title="Clip(裁剪)"
43
+ >
44
+ <DivClip />
45
+ </ContentBlock>
46
+ </div>
47
+ </template>
@@ -1,54 +1,65 @@
1
- <template>
2
- <div id='item-root'>
3
- <ContentBlock :class=contentClass :style="{ top: itemSides.height*0}" :=contentBlockProps :index=1 title="Radius(实现圆角)">
4
- <DivRadius/>
5
- </ContentBlock>
6
- <ContentBlock :class=contentClass :style="{ top: itemSides.height*1}" :=contentBlockProps :index=1 title="Transform">
7
- <DivTransform/>
8
- </ContentBlock>
9
- <ContentBlock :class=contentClass :style="{ top: itemSides.height*2}" :=contentBlockProps :index=2 title="CSS Var">
10
- <DivCssVar/>
11
- </ContentBlock>
12
- <ContentBlock :class=contentClass :style="{ top: itemSides.height*3}" :=contentBlockProps :index=3 title="CSS Scoped">
13
- <DivCssScoped jsvclass="block"/>
14
- </ContentBlock>
15
- </div>
16
- </template>
1
+ <script setup>
2
+ import ContentBlock from "../ContentBlock";
3
+ import DivCssScoped from "./DivCssScoped";
4
+ import DivCssVar from "./DivCssVar";
5
+ import DivRadius from "./DivRadius";
6
+ import DivTransform from "./DivTransform";
17
7
 
18
- <script>
19
- import ContentBlock from '../ContentBlock';
20
- import DivCssScoped from './DivCssScoped';
21
- import DivCssVar from './DivCssVar';
22
- import DivRadius from './DivRadius';
23
- import DivTransform from './DivTransform';
24
-
25
- export default {
26
- props: {
27
- contentClass: String,
28
- itemSides: Object
29
- },
30
- components: {
31
- ContentBlock,
32
- DivCssScoped,
33
- DivCssVar,
34
- DivRadius,
35
- DivTransform,
36
- },
37
- computed: {
38
- contentBlockProps() {
39
- return {
40
- colIndex: 0,
41
- itemSides: this.itemSides
42
- }
43
- }
44
- }
45
- }
8
+ const props = defineProps({
9
+ contentClass: String,
10
+ itemSides: Object,
11
+ });
12
+ const contentBlockProps = {
13
+ colIndex: 0,
14
+ itemSides: props.itemSides,
15
+ };
46
16
  </script>
47
17
 
18
+ <template>
19
+ <div id="item-root">
20
+ <ContentBlock
21
+ :class="contentClass"
22
+ :style="{ top: itemSides.height * 0 }"
23
+ :="contentBlockProps"
24
+ :index="1"
25
+ title="Radius(实现圆角)"
26
+ >
27
+ <DivRadius />
28
+ </ContentBlock>
29
+ <ContentBlock
30
+ :class="contentClass"
31
+ :style="{ top: itemSides.height * 1 }"
32
+ :="contentBlockProps"
33
+ :index="1"
34
+ title="Transform"
35
+ >
36
+ <DivTransform />
37
+ </ContentBlock>
38
+ <ContentBlock
39
+ :class="contentClass"
40
+ :style="{ top: itemSides.height * 2 }"
41
+ :="contentBlockProps"
42
+ :index="2"
43
+ title="CSS Var"
44
+ >
45
+ <DivCssVar />
46
+ </ContentBlock>
47
+ <ContentBlock
48
+ :class="contentClass"
49
+ :style="{ top: itemSides.height * 3 }"
50
+ :="contentBlockProps"
51
+ :index="3"
52
+ title="CSS Scoped"
53
+ >
54
+ <DivCssScoped jsvclass="block" />
55
+ </ContentBlock>
56
+ </div>
57
+ </template>
58
+
48
59
  <style scoped>
49
60
  .block {
50
61
  width: 80;
51
62
  height: 65;
52
- color: #00FF00;
63
+ color: #00ff00;
53
64
  }
54
65
  </style>
@@ -1,10 +1,39 @@
1
1
  <template>
2
- <div id='layout-root'>
3
- <div class="content-font" :style="{ width: 70, height: 50, backgroundColor: 'rgba(0, 255, 0, 1)' }">坐标未设</div>
2
+ <div id="layout-root">
3
+ <div
4
+ class="content-font"
5
+ :style="{ width: 70, height: 50, backgroundColor: 'rgba(0, 255, 0, 1)' }"
6
+ >
7
+ 坐标未设
8
+ </div>
4
9
  <!-- <div class="content-font" :style="{ top: 0, left: 75, backgroundColor: 'rgba(0, 255, 0, 1)' }">宽高未设</div> -->
5
- <div class="content-font" :style="{ top: 55, left: 0, width: 70, height: 50, backgroundColor: 'rgba(0, 200, 0, 1)', visibility: 'hidden' }">(X)不可视</div>
6
- <div class="content-font" :style="{ top: 55, left: 75, width: 70, height: 50, backgroundColor: 'rgba(0, 200, 0, 1)', visibility: 'visible' }">可视属性</div>
7
- </div>
10
+ <div
11
+ class="content-font"
12
+ :style="{
13
+ top: 55,
14
+ left: 0,
15
+ width: 70,
16
+ height: 50,
17
+ backgroundColor: 'rgba(0, 200, 0, 1)',
18
+ visibility: 'hidden',
19
+ }"
20
+ >
21
+ (X)不可视
22
+ </div>
23
+ <div
24
+ class="content-font"
25
+ :style="{
26
+ top: 55,
27
+ left: 75,
28
+ width: 70,
29
+ height: 50,
30
+ backgroundColor: 'rgba(0, 200, 0, 1)',
31
+ visibility: 'visible',
32
+ }"
33
+ >
34
+ 可视属性
35
+ </div>
36
+ </div>
8
37
  </template>
9
38
 
10
39
  <style>