@shijiu/jsview-vue-samples 1.9.887 → 1.9.915

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 (185) hide show
  1. package/AnimPicture/App.vue +10 -10
  2. package/Basic/App.vue +1 -1
  3. package/Basic/components/FontStyle.css +4 -4
  4. package/Basic/components/anim/AnimKeyframeBasic.vue +1 -1
  5. package/Basic/components/anim/AnimKeyframeComposite.vue +2 -2
  6. package/Basic/components/anim/AnimTransition.vue +4 -4
  7. package/Basic/components/div/DivClip.vue +0 -39
  8. package/Basic/components/div/DivCssScoped.vue +1 -1
  9. package/Basic/components/div/DivLayout.vue +1 -1
  10. package/Basic/components/div/DivRadius.vue +4 -4
  11. package/Basic/components/img/ImageGroup.vue +2 -2
  12. package/Basic/components/img/ImgLayout.vue +78 -14
  13. package/Basic/components/text/TextDirection.vue +9 -9
  14. package/Basic/components/text/TextEmoji.vue +7 -2
  15. package/Basic/components/text/TextFontStyle.vue +4 -4
  16. package/Basic/components/text/TextGroup1.vue +1 -1
  17. package/Basic/components/text/TextGroup2.vue +2 -2
  18. package/BasicFocusControl/App.vue +2 -2
  19. package/BasicFocusControl/components/BaseBlock.vue +2 -2
  20. package/BasicFocusControl/components/MainArea.vue +2 -2
  21. package/BasicFocusControl/components/SideBar.vue +2 -2
  22. package/Collision/App.vue +16 -16
  23. package/ColorSpace/App.vue +11 -11
  24. package/CssPreprocessor/App.vue +70 -0
  25. package/CssPreprocessor/Less/App.vue +32 -0
  26. package/CssPreprocessor/Less/PanelData.js +51 -0
  27. package/CssPreprocessor/Less/components/less-group1/LessComments.vue +34 -0
  28. package/CssPreprocessor/Less/components/less-group1/LessConditionals.vue +32 -0
  29. package/CssPreprocessor/Less/components/less-group1/LessOperations.vue +24 -0
  30. package/CssPreprocessor/Less/components/less-group1/LessVariables.vue +48 -0
  31. package/CssPreprocessor/Less/components/less-group2/LessIteration.vue +32 -0
  32. package/CssPreprocessor/Less/components/less-group2/LessMethods.vue +27 -0
  33. package/CssPreprocessor/Less/components/less-group3/LessExtends.vue +32 -0
  34. package/CssPreprocessor/Less/components/less-group3/LessNesting.vue +63 -0
  35. package/CssPreprocessor/Less/components/less-group4/LessKeyframes.vue +40 -0
  36. package/CssPreprocessor/Less/components/less-group4/LessMaps.vue +33 -0
  37. package/CssPreprocessor/Less/components/less-group4/LessMixins.vue +33 -0
  38. package/CssPreprocessor/Less/components/less-group5/LessImporting.vue +34 -0
  39. package/CssPreprocessor/Less/components/less-group5/TextSettings.less +4 -0
  40. package/CssPreprocessor/Scss/App.vue +32 -0
  41. package/CssPreprocessor/Scss/PanelData.js +51 -0
  42. package/CssPreprocessor/Scss/components/scss-group1/ScssComments.vue +34 -0
  43. package/CssPreprocessor/Scss/components/scss-group1/ScssConditionals.vue +36 -0
  44. package/CssPreprocessor/Scss/components/scss-group1/ScssOperations.vue +30 -0
  45. package/CssPreprocessor/Scss/components/scss-group1/ScssVariables.vue +48 -0
  46. package/CssPreprocessor/Scss/components/scss-group2/ScssIteration.vue +36 -0
  47. package/CssPreprocessor/Scss/components/scss-group2/ScssMethods.vue +84 -0
  48. package/CssPreprocessor/Scss/components/scss-group3/ScssExtends.vue +34 -0
  49. package/CssPreprocessor/Scss/components/scss-group3/ScssNesting.vue +75 -0
  50. package/CssPreprocessor/Scss/components/scss-group4/ScssKeyframes.vue +40 -0
  51. package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +35 -0
  52. package/CssPreprocessor/Scss/components/scss-group4/ScssMixins.vue +33 -0
  53. package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +34 -0
  54. package/CssPreprocessor/Scss/components/scss-group5/TextSettings.scss +4 -0
  55. package/CssPreprocessor/Stylus/App.vue +32 -0
  56. package/CssPreprocessor/Stylus/PanelData.js +51 -0
  57. package/CssPreprocessor/Stylus/components/stylus-group1/StylusComments.vue +34 -0
  58. package/CssPreprocessor/Stylus/components/stylus-group1/StylusConditionals.vue +36 -0
  59. package/CssPreprocessor/Stylus/components/stylus-group1/StylusOperations.vue +30 -0
  60. package/CssPreprocessor/Stylus/components/stylus-group1/StylusVariables.vue +47 -0
  61. package/CssPreprocessor/Stylus/components/stylus-group2/StylusIteration.vue +34 -0
  62. package/CssPreprocessor/Stylus/components/stylus-group2/StylusMethods.vue +78 -0
  63. package/CssPreprocessor/Stylus/components/stylus-group3/StylusExtends.vue +34 -0
  64. package/CssPreprocessor/Stylus/components/stylus-group3/StylusNesting.vue +63 -0
  65. package/CssPreprocessor/Stylus/components/stylus-group4/StylusKeyframes.vue +40 -0
  66. package/CssPreprocessor/Stylus/components/stylus-group4/StylusMaps.vue +33 -0
  67. package/CssPreprocessor/Stylus/components/stylus-group4/StylusMixins.vue +33 -0
  68. package/CssPreprocessor/Stylus/components/stylus-group5/StylusImporting.vue +34 -0
  69. package/CssPreprocessor/Stylus/components/stylus-group5/TextSettings.styl +4 -0
  70. package/CssPreprocessor/utils/ContentBlock.vue +43 -0
  71. package/CssPreprocessor/utils/ContentList.vue +34 -0
  72. package/CssPreprocessor/utils/FontStyle.css +19 -0
  73. package/CssPreprocessor/utils/Panel.vue +49 -0
  74. package/CssPreprocessor/utils/TitleBar.vue +29 -0
  75. package/DemoHomepage/App.vue +46 -11
  76. package/DemoHomepage/components/Dialog.vue +15 -15
  77. package/DemoHomepage/router.js +20 -12
  78. package/DemoHomepage/views/Homepage.vue +90 -102
  79. package/DivMetroPerformance/App.vue +150 -0
  80. package/DivMetroPerformance/Item.vue +58 -0
  81. package/DivMetroPerformance/assets/bg.jpg +0 -0
  82. package/DivMetroPerformance/assets/coupon_content.png +0 -0
  83. package/DivMetroPerformance/assets/coupon_left.png +0 -0
  84. package/DivMetroPerformance/assets/coupon_mid.png +0 -0
  85. package/DivMetroPerformance/assets/coupon_right.png +0 -0
  86. package/DivMetroPerformance/assets/focus_border.png +0 -0
  87. package/DivMetroPerformance/assets/holder_logo.png +0 -0
  88. package/DivMetroPerformance/assets/jrbm.png +0 -0
  89. package/DivMetroPerformance/assets/line_left.png +0 -0
  90. package/DivMetroPerformance/assets/line_mid.png +0 -0
  91. package/DivMetroPerformance/assets/line_right.png +0 -0
  92. package/DivMetroPerformance/assets/loading.png +0 -0
  93. package/DivMetroPerformance/assets/logo.png +0 -0
  94. package/DivMetroPerformance/assets/mcjx.png +0 -0
  95. package/DivMetroPerformance/assets/tao.png +0 -0
  96. package/DivMetroPerformance/assets/tmall.png +0 -0
  97. package/DivMetroPerformance/border.png +0 -0
  98. package/DivMetroPerformance/components/ContentItem.vue +385 -0
  99. package/DivMetroPerformance/components/MyTab.vue +129 -0
  100. package/DivMetroPerformance/data.js +124 -0
  101. package/DivMetroPerformance/utils/GridItem.vue +28 -0
  102. package/DivMetroPerformance/utils/GridPlate.vue +85 -0
  103. package/FilterDemo/AnimatePic.vue +3 -3
  104. package/FilterDemo/App.vue +3 -3
  105. package/FlipCard/App.vue +2 -2
  106. package/FlipCard/FlipCard.vue +2 -2
  107. package/GridDemo/Item.vue +13 -13
  108. package/HashHistory/App.vue +0 -1
  109. package/HashHistory/components/Item.vue +2 -2
  110. package/HashHistory/views/MainPage.vue +1 -1
  111. package/HashHistory/views/SubPage.vue +2 -2
  112. package/ImpactStop/App.vue +9 -11
  113. package/Input/InputPanel.vue +2 -4
  114. package/LongImage/App.vue +2 -2
  115. package/LongImage/Button.vue +1 -1
  116. package/LongImage/ButtonItem.vue +1 -1
  117. package/LongText/App.vue +3 -3
  118. package/LongText/Button.vue +1 -1
  119. package/LongText/ButtonItem.vue +1 -1
  120. package/LongText/LongTextScroll.vue +4 -4
  121. package/Marquee/longText.js +0 -2
  122. package/MaskClip/App.vue +4 -4
  123. package/MediaDemo/App.vue +127 -0
  124. package/MediaDemo/assets/audio-poster.png +0 -0
  125. package/MediaDemo/components/Button.vue +69 -0
  126. package/MediaDemo/components/Controllor.vue +279 -0
  127. package/MediaDemo/components/StatusBar.vue +100 -0
  128. package/MediaDemo/components/frames/AudioFrame.vue +39 -0
  129. package/MediaDemo/components/frames/AudioPoster.vue +48 -0
  130. package/MediaDemo/components/frames/MediaFrame.vue +153 -0
  131. package/MediaDemo/components/frames/VideoFrame.vue +39 -0
  132. package/MetroWidgetDemos/Advanced/ButtonItem.vue +4 -4
  133. package/MetroWidgetDemos/Advanced/widgets/Item.vue +5 -5
  134. package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +2 -2
  135. package/MetroWidgetDemos/Advanced/widgets/Widgets.vue +57 -56
  136. package/MetroWidgetDemos/Item.vue +4 -5
  137. package/MetroWidgetDemos/PerformanceTest/App.vue +3 -3
  138. package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +26 -26
  139. package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +15 -15
  140. package/MetroWidgetDemos/PingPong/AppPage.vue +2 -2
  141. package/MetroWidgetDemos/PingPong/TabItem.vue +2 -2
  142. package/MetroWidgetDemos/PingPong/ViewSwiper.vue +9 -9
  143. package/MetroWidgetDemos/Simple/RelativeTemplate.vue +2 -2
  144. package/MetroWidgetDemos/WidgetItem.vue +2 -2
  145. package/NinePatchDemo/App.vue +3 -3
  146. package/NinePatchDemo/Item.vue +5 -5
  147. package/Preload/App.vue +5 -5
  148. package/Preload/Item.vue +1 -1
  149. package/QrcodeDemo/App.vue +3 -3
  150. package/ScaleDownNeon/App.vue +9 -9
  151. package/SoundPool/App.vue +6 -9
  152. package/SprayView/App.vue +22 -22
  153. package/SpriteImage/App.vue +4 -4
  154. package/Swiper/App.vue +2 -8
  155. package/TextBox/App.vue +1 -2
  156. package/TextBox/RenderCenter.vue +16 -16
  157. package/TextBox/RenderLeft.vue +16 -16
  158. package/TextBox/RenderOneLine.vue +12 -12
  159. package/TextBox/RenderRight.vue +16 -16
  160. package/TextShadowDemo/App.vue +4 -4
  161. package/TextureAnimation/App.vue +1 -17
  162. package/TextureAnimation/App2.vue +3 -3
  163. package/TextureSize/App.vue +8 -8
  164. package/ThrowMoveDemo/AccelerateDemo.vue +4 -4
  165. package/ThrowMoveDemo/LRParabolicDemo.vue +4 -4
  166. package/ThrowMoveDemo/TargetDemo.vue +4 -4
  167. package/ThrowMoveDemo/UDParabolicDemo.vue +4 -4
  168. package/TouchSample/App.vue +2 -2
  169. package/TouchSample/Item.vue +2 -2
  170. package/TouchSample/MetroWidgetHorizontal.vue +3 -3
  171. package/TouchSample/MetroWidgetVertical.vue +3 -3
  172. package/TouchSample/TouchContainerHorizontal.vue +2 -2
  173. package/TouchSample/TouchContainerVertical.vue +2 -2
  174. package/TransitPage/App.vue +1 -1
  175. package/VideoDemo/App.vue +4 -4
  176. package/VideoDemo/components/Button.vue +1 -1
  177. package/VideoDemo/components/Controllor.vue +2 -2
  178. package/VideoDemo/components/VideoFrame.vue +1 -1
  179. package/VisibleSensorDemo/App.vue +7 -7
  180. package/assets/bmpDemo.bmp +0 -0
  181. package/assets/jpegDemo.jpeg +0 -0
  182. package/assets/pngDemo.png +0 -0
  183. package/assets/pngNoAlphaDemo.png +0 -0
  184. package/assets/webpDemo.webp +0 -0
  185. package/package.json +6 -1
@@ -1,8 +1,8 @@
1
1
  <script setup>
2
- import jpegDemo from "./jpegDemo.jpeg";
3
- import pngDemo from "./pngDemo.png";
4
- import pngNoAlphaDemo from "./pngNoAlphaDemo.png";
5
- import bmpDemo from "./bmpDemo.bmp";
2
+ import jpegDemo from "../assets/jpegDemo.jpeg";
3
+ import pngDemo from "../assets/pngDemo.png";
4
+ import pngNoAlphaDemo from "../assets/pngNoAlphaDemo.png";
5
+ import bmpDemo from "../assets/bmpDemo.bmp";
6
6
  import { useRouter } from "vue-router";
7
7
 
8
8
  const router = useRouter();
@@ -39,7 +39,7 @@ const onKeyDown = (ev) => {
39
39
  <img class="graphSize top0" :src="bmpDemo" />
40
40
  <img
41
41
  class="graphSize top250"
42
- jsvImgColorSpace="RGB_565"
42
+ data-jsv-img-color-space="RGB_565"
43
43
  :src="bmpDemo"
44
44
  />
45
45
  <div class="underFont">
@@ -51,7 +51,7 @@ const onKeyDown = (ev) => {
51
51
  <img class="graphSize top0" :src="jpegDemo" />
52
52
  <img
53
53
  class="graphSize top250"
54
- jsvImgColorSpace="RGB_565"
54
+ data-jsv-img-color-space="RGB_565"
55
55
  :src="jpegDemo"
56
56
  />
57
57
  <div class="underFont">
@@ -63,7 +63,7 @@ const onKeyDown = (ev) => {
63
63
  <img class="graphSize top0" :src="pngDemo" />
64
64
  <img
65
65
  class="graphSize top250"
66
- jsvImgColorSpace="RGB_565"
66
+ data-jsv-img-color-space="RGB_565"
67
67
  :src="pngDemo"
68
68
  />
69
69
  <div class="underFont">
@@ -75,7 +75,7 @@ const onKeyDown = (ev) => {
75
75
  <img class="graphSize top0" :src="pngNoAlphaDemo" />
76
76
  <img
77
77
  class="graphSize top250"
78
- jsvImgColorSpace="RGB_565"
78
+ data-jsv-img-color-space="RGB_565"
79
79
  :src="pngNoAlphaDemo"
80
80
  />
81
81
  <div class="underFont">
@@ -101,7 +101,7 @@ const onKeyDown = (ev) => {
101
101
  width: 200;
102
102
  height: 200;
103
103
  color: #ffffff;
104
- font-size: 30px;
104
+ font-size: 30;
105
105
  }
106
106
  .top0 {
107
107
  top: 0;
@@ -113,7 +113,7 @@ const onKeyDown = (ev) => {
113
113
  left: 0;
114
114
  width: 200;
115
115
  height: 200;
116
- border-radius: 15px 15px 15px 15px;
116
+ border-radius: 15 15 15 15;
117
117
  }
118
118
  .underFont {
119
119
  left: 0;
@@ -121,6 +121,6 @@ const onKeyDown = (ev) => {
121
121
  width: 200;
122
122
  height: 200;
123
123
  color: #ffffff;
124
- font-size: 20px;
124
+ font-size: 20;
125
125
  }
126
126
  </style>
@@ -0,0 +1,70 @@
1
+ <script>
2
+ import ScssApp from './Scss/App.vue';
3
+ import LessApp from './Less/App.vue';
4
+ import StylusApp from './Stylus/App.vue';
5
+
6
+ export default {
7
+ components: {
8
+ ScssApp,
9
+ LessApp,
10
+ StylusApp
11
+ },
12
+ data() {
13
+ return {
14
+ panelInfo: {
15
+ index: 1,
16
+ total: 3,
17
+ desc: "1/3",
18
+ }
19
+ };
20
+ },
21
+ mounted() {
22
+ },
23
+ methods: {
24
+ onKeyDown(ev) {
25
+ console.log('onKeyDown');
26
+ // 8:Backspace, 27:Escape, 10000:盒子返回键
27
+ if(ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
28
+ console.log("Basic has this.$router: ", !!this.$router)
29
+ this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
30
+ return true;
31
+ } else if(ev.keyCode == 37) { // left
32
+ this.panelInfo.index = (--this.panelInfo.index > 1 ? this.panelInfo.index : 1);
33
+ this.panelInfo.desc = (this.panelInfo.index + '/' + this.panelInfo.total);
34
+ return true;
35
+ } else if(ev.keyCode == 39) { // right
36
+ this.panelInfo.index = (++this.panelInfo.index < this.panelInfo.total ? this.panelInfo.index : this.panelInfo.total);
37
+ this.panelInfo.desc = (this.panelInfo.index + '/' + this.panelInfo.total);
38
+ return true;
39
+ }
40
+
41
+ return false;
42
+ }
43
+ },
44
+ }
45
+ </script>
46
+
47
+ <template>
48
+ <div>
49
+ <!-- 有router时,将按键交给router去处理,此处没有其他用处 -->
50
+ <jsv-focus-block autoFocus :onKeyDown="onKeyDown"/>
51
+
52
+ <div clcss="root">
53
+ <ScssApp v-if="panelInfo.index == 1"/>
54
+ <LessApp v-else-if="panelInfo.index == 2"/>
55
+ <StylusApp v-else-if="panelInfo.index == 3"/>
56
+ <div :style="{top: 660, left:30, width:50}">
57
+ {{ panelInfo.desc }}
58
+ </div>
59
+ <div :style="{top: 660, left:100, width:500}">
60
+ 按左/右键切换Panel,按Back键返回
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </template>
65
+
66
+ <style scoped>
67
+ .root {
68
+ color: #0000FF;
69
+ }
70
+ </style>
@@ -0,0 +1,32 @@
1
+ <script>
2
+ import { panelData } from './PanelData';
3
+ import Panel from '../utils/Panel.vue';
4
+
5
+ export default {
6
+ components: {
7
+ Panel
8
+ },
9
+ setup() {
10
+ return {
11
+ panelData,
12
+ };
13
+ },
14
+ }
15
+ </script>
16
+
17
+ <template>
18
+ <div>
19
+ <div class="root">
20
+ <Panel :style="{top:10, left:10, width:1230, height:640}"
21
+ :panelData=panelData :sideline=true />
22
+ </div>
23
+ </div>
24
+ </template>
25
+
26
+ <style scoped>
27
+ .root {
28
+ top: 10; left: 10;
29
+ width: 1250; height: 670;
30
+ background-color: rgba(200, 200, 200, 1)
31
+ }
32
+ </style>
@@ -0,0 +1,51 @@
1
+ import LessComments from './components/less-group1/LessComments.vue';
2
+ import LessOperations from './components/less-group1/LessOperations.vue';
3
+ import LessVariables from './components/less-group1/LessVariables.vue';
4
+ import LessConditionals from './components/less-group1/LessConditionals.vue';
5
+ import LessIteration from './components/less-group2/LessIteration.vue';
6
+ import LessMethods from './components/less-group2/LessMethods.vue';
7
+ import LessExtends from './components/less-group3/LessExtends.vue';
8
+ import LessNesting from './components/less-group3/LessNesting.vue';
9
+ import LessMixins from './components/less-group4/LessMixins.vue';
10
+ import LessMaps from './components/less-group4/LessMaps.vue';
11
+ import LessKeyframes from './components/less-group4/LessKeyframes.vue';
12
+ import LessImporting from './components/less-group5/LessImporting.vue';
13
+
14
+ const titleData = [
15
+ 'Less 注释、运算符、变量、条件',
16
+ 'Less 迭代、方法',
17
+ 'Less 继承、嵌套',
18
+ 'Less 混入、映射、关键帧',
19
+ 'Less 导入',
20
+ ];
21
+
22
+ const contentListData = [
23
+ [
24
+ { title: "注释- //, /**/", obj: LessComments },
25
+ { title: "运算符- [ +,-,*,/,... ]", obj: LessOperations },
26
+ { title: "变量- @var, .a{@var}", obj: LessVariables },
27
+ { title: "条件- if(expr, true, false)", obj: LessConditionals },
28
+ ],
29
+ [
30
+ { title: "迭代- each(range(), {})", obj: LessIteration },
31
+ { title: "方法- 不支持", obj: LessMethods, zoom: 3 },
32
+ ],
33
+ [
34
+ { title: "继承- :extend()", obj: LessExtends },
35
+ { title: "嵌套- .a{.b{}}", obj: LessNesting, zoom: 3 },
36
+ ],
37
+ [
38
+ { title: "混入- .name(var)", obj: LessMixins},
39
+ { title: "映射- @name:{key:value}", obj: LessMaps},
40
+ { title: "关键帧- @keyframes", obj: LessKeyframes},
41
+ ],
42
+ [
43
+ { title: "导入- @import", obj: LessImporting, zoom: 2 },
44
+ { title: undefined, obj: undefined, zoom: 0 },
45
+ ],
46
+ ];
47
+
48
+ export const panelData = {
49
+ title: titleData,
50
+ contentList: contentListData
51
+ }
@@ -0,0 +1,34 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-comments">
9
+ {{'// less 单行注释\n'
10
+ + '/* less 多行注释 */\n'
11
+ + '.less-comments {\n'
12
+ + ' // less 单行注释\n'
13
+ + ' /* less 多行注释 */\n'
14
+ + ' color: #00FF00;\n'
15
+ + '}'}}
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <style scoped lang="less">
21
+ // less 单行注释
22
+ /* less 多行注释 */
23
+ .less-comments {
24
+ // less 单行注释
25
+ /* less 多行注释 */
26
+ color: #00FF00;
27
+ font-size: 14;
28
+
29
+ left: 10;
30
+ top: 3;
31
+ width: 230;
32
+ height: 130;
33
+ }
34
+ </style>
@@ -0,0 +1,32 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-conditional">
9
+ {{'@show-green: false;\n'
10
+ + '.less-conditional {\n'
11
+ + ' color: if(@show-green,\n'
12
+ + ' #00FF00,\n'
13
+ + ' #FF0000);\n'
14
+ + '}\n'}}
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <style scoped lang="less">
20
+ @show-green: false;
21
+ .less-conditional {
22
+ color: if(@show-green,
23
+ #00FF00,
24
+ #FF0000);
25
+
26
+ font-size: 14;
27
+ left: 10;
28
+ top: 5;
29
+ width: 220;
30
+ height: 140;
31
+ }
32
+ </style>
@@ -0,0 +1,24 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-op">
9
+ {{'+, -, *, /\n'}}
10
+ </div>
11
+ </div>
12
+ </template>
13
+
14
+ <style scoped lang="less">
15
+ .less-op {
16
+ color: #001100 * 16;
17
+ font-size: 20 - 6;
18
+
19
+ left: 10;
20
+ top: 3;
21
+ width: 230;
22
+ height: 280;
23
+ }
24
+ </style>
@@ -0,0 +1,48 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-var-general">
9
+ {{'@my-color: #00FF00; // 一般变量\n'
10
+ + '.less-var-general {\n'
11
+ + ' color: @my-color;\n'
12
+ + '}'}}
13
+ </div>
14
+ <div class="less-var-enclosing">
15
+ {{'.less-var-enclosing {\n'
16
+ + ' @my-color: #0000FF; // 局部变量\n'
17
+ + ' color: @my-color;\n'
18
+ + '}'}}
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <style scoped lang="less">
24
+ @my-color: #00FF00; // 一般变量
25
+ .less-var-general {
26
+ color: @my-color;
27
+
28
+ font-size: 14;
29
+ left: 10;
30
+ top: 0;
31
+ width: 220;
32
+ height: 140;
33
+ }
34
+
35
+ @my-color: #00FF00;
36
+ .less-var-enclosing {
37
+ // 只在 .less-enclosing 里有效,局部作用域
38
+ @my-color: #FF0000; // 局部变量
39
+ color: @my-color;
40
+
41
+ font-size: 14;
42
+ left: 10;
43
+ top: 68;
44
+ width: 220;
45
+ height: 140;
46
+ }
47
+
48
+ </style>
@@ -0,0 +1,32 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-bounds less-iteration-2">
9
+ {{'each(range(1, 14, 13), {\n'
10
+ + ' .less-iteration-@{index} {\n'
11
+ + ' font-size: @value;\n'
12
+ + ' }\n'
13
+ + '})'}}
14
+ </div>
15
+ </div>
16
+ </template>
17
+
18
+ <style scoped lang="less">
19
+ each(range(1, 14, 13), {
20
+ .less-iteration-@{index} {
21
+ font-size: @value;
22
+ }
23
+ })
24
+
25
+ .less-bounds {
26
+ color: #00FF00;
27
+ left: 10;
28
+ top: 3;
29
+ width: 230;
30
+ height: 280;
31
+ }
32
+ </style>
@@ -0,0 +1,27 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-method-general">
9
+ {{'不支持,使用mixins'}}
10
+ </div>
11
+ </div>
12
+ </template>
13
+
14
+ <style scoped lang="less">
15
+ .getsize(@zoom) {
16
+ font-size: 2 * @zoom
17
+ }
18
+ .less-method-general {
19
+ .getsize(7);
20
+
21
+ color: #000000;
22
+ left: 10;
23
+ top: 10;
24
+ width: 240;
25
+ height: 140;
26
+ }
27
+ </style>
@@ -0,0 +1,32 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-extend">
9
+ {{'.less-basic {\n'
10
+ + ' color: #00FF00;\n'
11
+ + '}\n'
12
+ + '.less-extend :extend(.less-basic) {\n'
13
+ + ' font-size: 14;\n'
14
+ + '}'}}
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <style scoped lang='less'>
20
+ .less-basic {
21
+ color: #00FF00;
22
+ }
23
+
24
+ .less-extend :extend(.less-basic) {
25
+ font-size: 14;
26
+
27
+ left: 10;
28
+ top: 3;
29
+ width: 230;
30
+ height: 140;
31
+ }
32
+ </style>
@@ -0,0 +1,63 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div class="less-root">
8
+ <div class="less-rule-nesting">
9
+ {{'.less-root {\n'
10
+ + ' color: #00FF00;\n'
11
+ + ' .less-rule-nesting { // 规则嵌套\n'
12
+ + ' font-size: 14;\n'
13
+ + ' }\n'
14
+ + '}'}}
15
+ </div>
16
+ <div class="less-prop-nesting">
17
+ {{'// 属性嵌套\n'
18
+ + '不支持'}}
19
+ </div>
20
+ <div class="less-root-parent-selector">
21
+ {{'.less-root {\n'
22
+ + ' color: #00FF00;\n'
23
+ + ' &-parent-selector { // 父选择器\n'
24
+ + ' font-size: 14;\n'
25
+ + ' }\n'
26
+ + '}'}}
27
+ </div>
28
+ </div>
29
+ </template>
30
+
31
+ <style scoped lang='less'>
32
+ .less-root {
33
+ color: #00FF00;
34
+
35
+ .less-rule-nesting { // 规则嵌套
36
+ font-size: 14;
37
+
38
+ left: 10;
39
+ top: 3;
40
+ width: 230;
41
+ height: 140;
42
+ }
43
+
44
+ .less-prop-nesting { // 属性嵌套(不支持)
45
+ color: #000000;
46
+ font-size: 14;
47
+
48
+ left: 10;
49
+ top: 120;
50
+ width: 230;
51
+ height: 140;
52
+ }
53
+
54
+ &-parent-selector { // 父选择器
55
+ font-size: 14;
56
+
57
+ left: 10;
58
+ top: 280;
59
+ width: 230;
60
+ height: 140;
61
+ }
62
+ }
63
+ </style>
@@ -0,0 +1,40 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-keyframes" :style="{ animation: 'scale-anim 3s infinite linear' }">
9
+ {{'@keyframes scale-anim {\n'
10
+ + ' from {\n'
11
+ + ' transform scale3d(1.0, 1.0, 1)\n'
12
+ + ' }\n'
13
+ + ' to {\n'
14
+ + ' transform scale3d(0.8, 0.8, 1)\n'
15
+ + ' }\n'
16
+ + '}'}}
17
+ </div>
18
+ </div>
19
+ </template>
20
+
21
+ <style scoped lang="less">
22
+ @keyframes scale-anim {
23
+ from {
24
+ transform: scale3d(1.0, 1.0, 1);
25
+ }
26
+ to {
27
+ transform: scale3d(0.8, 0.8, 1);
28
+ }
29
+ }
30
+
31
+ .less-keyframes {
32
+ color: #00FF00;
33
+ font-size: 14;
34
+
35
+ left: 10;
36
+ top: 0;
37
+ width: 230;
38
+ height: 140;
39
+ }
40
+ </style>
@@ -0,0 +1,33 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-map">
9
+ {{'@font-sizes: {\n'
10
+ + ' small: 10; medium: 14; large: 18;\n'
11
+ + '}\n'
12
+ + '.less-map {\n'
13
+ + ' font-size: @font-sizes[medium];\n'
14
+ + '}'}}
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <style scoped lang='less'>
20
+ @font-sizes: {
21
+ small: 10; medium: 14; large: 18;
22
+ }
23
+
24
+ .less-map {
25
+ font-size: @font-sizes[medium];
26
+
27
+ color: #00FF00;
28
+ left: 10;
29
+ top: 3;
30
+ width: 230;
31
+ height: 140;
32
+ }
33
+ </style>
@@ -0,0 +1,33 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-mixin">
9
+ {{'.font(@size) {\n'
10
+ + ' font-size: @size;\n'
11
+ + '}\n'
12
+ + '.less-mixin {\n'
13
+ + ' .font(14);\n'
14
+ + '}'}}
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <style scoped lang='less'>
20
+ .font(@size) {
21
+ font-size: @size;
22
+ }
23
+
24
+ .less-mixin {
25
+ .font(14);
26
+
27
+ color: #00FF00;
28
+ left: 10;
29
+ top: 0;
30
+ width: 230;
31
+ height: 140;
32
+ }
33
+ </style>
@@ -0,0 +1,34 @@
1
+ <script>
2
+ export default {
3
+ }
4
+ </script>
5
+
6
+ <template>
7
+ <div>
8
+ <div class="less-bounds less-imported">
9
+ {{'LessImportFile.vue\n'
10
+ + '\n'
11
+ + '<style scoped lang=\'less\'>\n'
12
+ + '@import \'./TextSettings\';\n'
13
+ + '</style>\n'
14
+ + '\n'
15
+ + '=================\n'
16
+ + 'TextSettings.less\n'
17
+ + '\n'
18
+ + '.less-imported {\n'
19
+ + ' color: #00FF00;\n'
20
+ + ' font-size: 14;\n'
21
+ + '}'}}
22
+ </div>
23
+ </div>
24
+ </template>
25
+
26
+ <style scoped lang='less'>
27
+ @import './TextSettings';
28
+ .less-bounds {
29
+ left: 10;
30
+ top: 0;
31
+ width: 230;
32
+ height: 280;
33
+ }
34
+ </style>
@@ -0,0 +1,4 @@
1
+ .less-imported {
2
+ color: #00FF00;
3
+ font-size: 14;
4
+ }