@shijiu/jsview-vue-samples 2.0.1073 → 2.0.1106

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 (90) hide show
  1. package/Basic/components/div/DivBackground.vue +13 -25
  2. package/Basic/components/img/ImageGroup.vue +14 -20
  3. package/Basic/components/img/ImgLayout.vue +59 -68
  4. package/BasicFocusControl/components/BaseBlock.vue +11 -17
  5. package/BasicFocusControl/components/MainAreaLeftBlock.vue +2 -2
  6. package/BasicFocusControl/components/MainAreaRightBlock.vue +2 -2
  7. package/BasicFocusControl/components/SideBarBlock.vue +2 -2
  8. package/CssPreprocessor/App.vue +40 -51
  9. package/CssPreprocessor/Less/App.vue +6 -14
  10. package/CssPreprocessor/Scss/App.vue +6 -14
  11. package/CssPreprocessor/Scss/components/scss-group1/ScssOperations.vue +0 -1
  12. package/CssPreprocessor/Stylus/App.vue +6 -14
  13. package/CssPreprocessor/utils/ContentBlock.vue +30 -12
  14. package/CssPreprocessor/utils/ContentList.vue +23 -14
  15. package/CssPreprocessor/utils/Panel.vue +34 -23
  16. package/CssPreprocessor/utils/TitleBar.vue +7 -9
  17. package/DemoHomepage/components/BodyFrame.vue +54 -78
  18. package/DemoHomepage/components/Dialog.vue +38 -43
  19. package/DemoHomepage/components/Item.vue +52 -55
  20. package/DemoHomepage/components/TabFrame.vue +43 -72
  21. package/DemoHomepage/router.js +1 -1
  22. package/GiftRain/App.vue +10 -4
  23. package/GridDemo/App.vue +5 -5
  24. package/GridDemo/FocusItem.vue +3 -5
  25. package/GridDemo/Item.vue +4 -24
  26. package/HashHistory/App.vue +0 -10
  27. package/HashHistory/views/MainPage.vue +0 -1
  28. package/ImpactStop/App.vue +0 -1
  29. package/Input/App.vue +106 -150
  30. package/Input/FullKeyboard.vue +18 -28
  31. package/Input/InputPanel.vue +87 -109
  32. package/Input/KeyboardItem.vue +35 -45
  33. package/JsvRadarChart/App.vue +16 -19
  34. package/LongImage/Button.vue +2 -3
  35. package/LongText/App.vue +0 -3
  36. package/LongText/Button.vue +0 -1
  37. package/LongText/LongTextScroll.vue +0 -4
  38. package/Marquee/App.vue +1 -0
  39. package/MetroWidgetDemos/PerformanceTest/App.vue +2 -3
  40. package/MetroWidgetDemos/PerformanceTest/Item.vue +52 -55
  41. package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +26 -26
  42. package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +86 -95
  43. package/MetroWidgetDemos/PingPong/App.vue +56 -89
  44. package/MetroWidgetDemos/PingPong/AppPage.vue +3 -3
  45. package/MetroWidgetDemos/PingPong/Item.vue +1 -1
  46. package/MetroWidgetDemos/PingPong/TabItem.vue +3 -3
  47. package/MetroWidgetDemos/PingPong/WidgetItem.vue +1 -1
  48. package/MetroWidgetDemos/SkeletonDiagram/App.vue +2 -4
  49. package/MetroWidgetDemos/basic/Item.vue +1 -1
  50. package/MetroWidgetDemos/direction/App.vue +0 -2
  51. package/MetroWidgetDemos/direction/Item.vue +1 -1
  52. package/MetroWidgetDemos/focusableItemBasic/App.vue +1 -1
  53. package/MetroWidgetDemos/focusableItemBasic/ButtonItem.vue +1 -1
  54. package/MetroWidgetDemos/focusableItemMetroWidget/App.vue +1 -1
  55. package/MetroWidgetDemos/focusableItemMetroWidget/Item.vue +1 -1
  56. package/MetroWidgetDemos/focusableItemMetroWidget/WidgetItem.vue +1 -1
  57. package/MetroWidgetDemos/focusableItemMix/App.vue +1 -1
  58. package/MetroWidgetDemos/focusableItemMix/ButtonItem.vue +1 -1
  59. package/MetroWidgetDemos/focusableItemMix/Item.vue +1 -1
  60. package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +23 -25
  61. package/MetroWidgetDemos/layoutType/App.vue +0 -2
  62. package/MetroWidgetDemos/layoutType/Item.vue +1 -1
  63. package/MetroWidgetDemos/ninePatchFocusPage/App.vue +0 -1
  64. package/MetroWidgetDemos/ninePatchFocusPage/PageRow.vue +1 -1
  65. package/MetroWidgetDemos/padding/App.vue +0 -2
  66. package/MetroWidgetDemos/padding/Item.vue +1 -1
  67. package/MetroWidgetDemos/slideSetting/Item.vue +1 -1
  68. package/MockjsDemo/App.vue +26 -11
  69. package/MockjsDemo/mock/index.js +9 -1
  70. package/QrcodeDemo/App.vue +0 -1
  71. package/SoundPool/App.vue +1 -2
  72. package/SpriteImage/App.vue +89 -125
  73. package/Swiper/App.vue +1 -3
  74. package/TestNativeSharedView/App.vue +104 -48
  75. package/TextBox/RenderCenter.vue +89 -113
  76. package/TextBox/RenderLeft.vue +89 -113
  77. package/TextBox/RenderOneLine.vue +7 -10
  78. package/TextBox/RenderRight.vue +8 -11
  79. package/TextShadowDemo/App.vue +54 -75
  80. package/TextureAnimation/App.vue +175 -287
  81. package/TextureAnimation/App2.vue +1 -5
  82. package/ThrowMoveDemo/AccelerateDemo.vue +40 -71
  83. package/ThrowMoveDemo/App.vue +13 -23
  84. package/ThrowMoveDemo/TargetDemo.vue +24 -53
  85. package/ThrowMoveDemo/UDParabolicDemo.vue +31 -60
  86. package/VideoDemo/App.vue +71 -116
  87. package/package.json +1 -1
  88. package/VideoDemo/components/Button.vue +0 -58
  89. package/VideoDemo/components/Controllor.vue +0 -197
  90. package/VideoDemo/components/VideoFrame.vue +0 -140
@@ -4,48 +4,36 @@ import iconImgPath from "../../assets/icon.png";
4
4
 
5
5
  <template>
6
6
  <div id="layout-root">
7
- <div
8
- class="content-font"
9
- :style="{
10
- width: 180,
11
- height: 40,
12
- backgroundColor: 'rgba(255, 255, 0, 1)',
13
- }"
14
- >
7
+ <div class="content-font" :style="{
8
+ width: 180,
9
+ height: 40,
10
+ backgroundColor: 'rgba(255, 255, 0, 1)',
11
+ }">
15
12
  style.backgroundColor
16
13
  </div>
17
- <div
18
- class="content-font"
19
- :style="{
14
+ <div class="content-font" :style="{
20
15
  top: 50,
21
16
  width: 180,
22
17
  height: 40,
23
18
  backgroundImage: `url(${iconImgPath})`,
24
- }"
25
- >
19
+ }">
26
20
  style.backgroundImage(url)
27
21
  </div>
28
- <div
29
- class="content-font"
30
- :style="{
22
+ <div class="content-font" :style="{
31
23
  top: 100,
32
24
  width: 90,
33
25
  height: 40,
34
- backgroundImage: 'linear-gradient(to left bottom, rgba(255, 0, 0, 1.0), rgba(0,255,0,1.0), rgba(0,0,255,1.0))',
35
- }"
36
- >
26
+ backgroundImage: 'linear-gradient(to left bottom, rgba(255, 0, 0, 1), rgba(0,255,0,1), rgba(0,0,255,1))',
27
+ }">
37
28
  gradient
38
29
  </div>
39
- <div
40
- class="content-font"
41
- :style="{
30
+ <div class="content-font" :style="{
42
31
  top: 100,
43
32
  left: 92,
44
33
  width: 90,
45
34
  height: 40,
46
- backgroundImage: 'linear-gradient(rgba(255, 0, 0, 1.0), rgba(0,255,0,1.0))',
47
- }"
48
- >
35
+ backgroundImage: 'linear-gradient(rgba(255, 0, 0, 1), rgba(0,255,0,1))',
36
+ }">
49
37
  gradient
50
38
  </div>
51
39
  </div>
@@ -1,31 +1,25 @@
1
1
  <template>
2
2
  <div id='item-root'>
3
- <ContentBlock :class=contentClass :style="{top:itemSides.height*0}" :=contentBlockProps :index=0 title="img标签ObjectFit">
4
- <ImgLayout/>
3
+ <ContentBlock :class=props.contentClass :style="{ top: itemSides.height * 0 }" :=contentBlockProps :index=0
4
+ title="img标签ObjectFit">
5
+ <ImgLayout />
5
6
  </ContentBlock>
6
7
  </div>
7
8
  </template>
8
9
 
9
- <script>
10
+ <script setup>
10
11
  import ContentBlock from '../ContentBlock.vue';
11
12
  import ImgLayout from './ImgLayout.vue';
13
+ import { computed } from "vue"
12
14
 
13
- export default {
14
- props: {
15
- contentClass: String,
16
- itemSides: Object
17
- },
18
- components: {
19
- ContentBlock,
20
- ImgLayout,
21
- },
22
- computed: {
23
- contentBlockProps() {
24
- return {
25
- colIndex: 0,
26
- itemSides:{...this.itemSides, height: this.itemSides.height * 2}
27
- }
28
- }
15
+ const props = defineProps({
16
+ contentClass: String,
17
+ itemSides: Object
18
+ })
19
+ const contentBlockProps = computed(() => {
20
+ return {
21
+ colIndex: 0,
22
+ itemSides: { ...props.itemSides, height: props.itemSides.height * 2 }
29
23
  }
30
- }
24
+ })
31
25
  </script>
@@ -1,80 +1,69 @@
1
1
  <template>
2
- <div id='layout-root'>
3
- <div style="{top: 0}">
4
- <div id="0列0行" :style="{left: coloumWidth * 0, top: tabLineHeight * 0}">
5
- <div class="content-font titleStyle"> fill(缩放变形)</div>
6
- <div class="frameStyle">
7
- <img class="imageStyle" :style="{ objectFit: 'fill' }"
8
- :src="testImgPath"/>
2
+ <div id='layout-root'>
3
+ <div style="{top: 0}">
4
+ <div id="0列0行" :style="{ left: coloumWidth * 0, top: tabLineHeight * 0 }">
5
+ <div class="content-font titleStyle"> fill(缩放变形)</div>
6
+ <div class="frameStyle">
7
+ <img class="imageStyle" :style="{ objectFit: 'fill' }" :src="testImgPath" />
8
+ </div>
9
9
  </div>
10
- </div>
11
- <div id="1列0行" :style="{left: coloumWidth * 1, top: tabLineHeight * 0}">
12
- <div class="content-font titleStyle">contain</div>
13
- <div class="frameStyle">
14
- <img class="imageStyle" :style="{ objectFit: 'contain' }"
15
- :src="testImgPath"/>
10
+ <div id="1列0行" :style="{ left: coloumWidth * 1, top: tabLineHeight * 0 }">
11
+ <div class="content-font titleStyle">contain</div>
12
+ <div class="frameStyle">
13
+ <img class="imageStyle" :style="{ objectFit: 'contain' }" :src="testImgPath" />
14
+ </div>
16
15
  </div>
17
- </div>
18
- <div id="0列1行" :style="{left: coloumWidth * 0, top: tabLineHeight * 1}">
19
- <div class="content-font titleStyle">none</div>
20
- <div class="frameStyle">
21
- <img class="imageStyle" :style="{ objectFit: 'none' }"
22
- :src="testImgPath"/>
16
+ <div id="0列1行" :style="{ left: coloumWidth * 0, top: tabLineHeight * 1 }">
17
+ <div class="content-font titleStyle">none</div>
18
+ <div class="frameStyle">
19
+ <img class="imageStyle" :style="{ objectFit: 'none' }" :src="testImgPath" />
20
+ </div>
23
21
  </div>
24
- </div>
25
- <div id="1列1行" :style="{left: coloumWidth * 1, top: tabLineHeight * 1}">
26
- <div class="content-font titleStyle">scale-down</div>
27
- <div class="frameStyle">
28
- <img class="imageStyle" :style="{ objectFit: 'scale-down' }"
29
- :src="testImgPath"/>
22
+ <div id="1列1行" :style="{ left: coloumWidth * 1, top: tabLineHeight * 1 }">
23
+ <div class="content-font titleStyle">scale-down</div>
24
+ <div class="frameStyle">
25
+ <img class="imageStyle" :style="{ objectFit: 'scale-down' }" :src="testImgPath" />
26
+ </div>
30
27
  </div>
31
- </div>
32
- <div id="0列2行" :style="{left: coloumWidth * 0, top: tabLineHeight * 2}">
33
- <div class="content-font titleStyle">cover</div>
34
- <div class="frameStyle">
35
- <img class="imageStyle" :style="{ objectFit: 'cover' }"
36
- :src="testImgPath"/>
28
+ <div id="0列2行" :style="{ left: coloumWidth * 0, top: tabLineHeight * 2 }">
29
+ <div class="content-font titleStyle">cover</div>
30
+ <div class="frameStyle">
31
+ <img class="imageStyle" :style="{ objectFit: 'cover' }" :src="testImgPath" />
32
+ </div>
37
33
  </div>
38
- </div>
39
- <div id="1列2行" :style="{left: coloumWidth * 1, top: tabLineHeight * 2}">
40
- <div class="content-font titleStyle">none(小图)</div>
41
- <div class="frameStyle">
42
- <img class="imageStyle" :style="{ objectFit: 'none' }"
43
- :src="tinyImgPath"/>
34
+ <div id="1列2行" :style="{ left: coloumWidth * 1, top: tabLineHeight * 2 }">
35
+ <div class="content-font titleStyle">none(小图)</div>
36
+ <div class="frameStyle">
37
+ <img class="imageStyle" :style="{ objectFit: 'none' }" :src="tinyImgPath" />
38
+ </div>
44
39
  </div>
45
- </div>
46
- <div id="0列3行" :style="{left: coloumWidth * 0, top: tabLineHeight * 3}">
47
- <div class="content-font titleStyle">scale-down(小图)</div>
48
- <div class="frameStyle">
49
- <img class="imageStyle" :style="{ objectFit: 'scale-down' }"
50
- :src="tinyImgPath"/>
40
+ <div id="0列3行" :style="{ left: coloumWidth * 0, top: tabLineHeight * 3 }">
41
+ <div class="content-font titleStyle">scale-down(小图)</div>
42
+ <div class="frameStyle">
43
+ <img class="imageStyle" :style="{ objectFit: 'scale-down' }" :src="tinyImgPath" />
44
+ </div>
51
45
  </div>
52
46
  </div>
53
47
  </div>
54
- </div>
55
48
  </template>
56
49
 
57
- <script>
58
- import testImgPath from '../../assets/test.jpg';
59
- import tinyImgPath from '../../assets/icon.png';
60
-
61
- export default {
62
- computed: {
63
- testImgPath() {
64
- return testImgPath;
65
- },
66
- tinyImgPath() {
67
- return tinyImgPath;
68
- },
69
- coloumWidth() {
70
- return 120;
71
- },
72
- tabLineHeight() {
73
- return 76; // imageSize.height + 26
74
- }
75
- }
76
- }
50
+ <script setup>
51
+ import testImgPath1 from '../../assets/test.jpg';
52
+ import tinyImgPath1 from '../../assets/icon.png';
53
+ import { computed } from "vue"
77
54
 
55
+ const testImgPath = computed(() => {
56
+ return testImgPath1;
57
+ })
58
+ const tinyImgPath = computed(() => {
59
+ return tinyImgPath1;
60
+ })
61
+ const coloumWidth = computed(() => {
62
+ return 120;
63
+ })
64
+ const tabLineHeight = computed(() => {
65
+ return 76;// imageSize.height + 26
66
+ })
78
67
  </script>
79
68
 
80
69
 
@@ -96,10 +85,12 @@ export default {
96
85
  }
97
86
 
98
87
  .frameStyle {
99
- top: 16; /* titleHeight */
100
- width: 104; /* imageSize.width+4 */
101
- height: 54; /* imageSize.height+4 */
88
+ top: 16;
89
+ /* titleHeight */
90
+ width: 104;
91
+ /* imageSize.width+4 */
92
+ height: 54;
93
+ /* imageSize.height+4 */
102
94
  background-color: rgba(0, 255, 0, 1)
103
95
  }
104
-
105
96
  </style>
@@ -27,23 +27,17 @@ const onBlur = () => {
27
27
  </script>
28
28
 
29
29
  <template>
30
- <jsv-focus-block
31
- ref="blockRef"
32
- :name="name"
33
- :onAction="{
34
- onKeyDown,
35
- onFocus,
36
- onBlur,
37
- }"
38
- >
39
- <div
40
- :style="{
41
- ...$props.style,
42
- width: 100,
43
- height: 100,
44
- backgroundColor: hasFocused ? 'rgba(255,0,0,1)' : 'rgba(0,255,0,1)',
45
- }"
46
- >
30
+ <jsv-focus-block ref="blockRef" :name="props.name" :onAction="{
31
+ onKeyDown,
32
+ onFocus,
33
+ onBlur,
34
+ }">
35
+ <div :style="{
36
+ ...props.style,
37
+ width: 100,
38
+ height: 100,
39
+ backgroundColor: hasFocused ? 'rgba(255,0,0,1)' : 'rgba(0,255,0,1)',
40
+ }">
47
41
  {{ fullName }}
48
42
  </div>
49
43
  </jsv-focus-block>
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
2
  import BaseBlock from "./BaseBlock.vue";
3
3
 
4
- defineProps({
4
+ const props = defineProps({
5
5
  name: String,
6
6
  style: {
7
7
  type: Object,
@@ -13,5 +13,5 @@ defineProps({
13
13
  </script>
14
14
 
15
15
  <template>
16
- <BaseBlock :name="name" :style="style" />
16
+ <BaseBlock :name="props.name" :style="props.style" />
17
17
  </template>
@@ -1,7 +1,7 @@
1
1
  <script setup>
2
2
  import BaseBlock from "./BaseBlock.vue";
3
3
  import { useFocusHub } from "jsview";
4
- defineProps({
4
+ const props=defineProps({
5
5
  name: String,
6
6
  style: {
7
7
  type: Object,
@@ -23,5 +23,5 @@ const onKeyDown = (ev) => {
23
23
  </script>
24
24
 
25
25
  <template>
26
- <BaseBlock :name="name" :style="style" :onKeyDown="onKeyDown" />
26
+ <BaseBlock :name="props.name" :style="props.style" :onKeyDown="onKeyDown" />
27
27
  </template>
@@ -2,7 +2,7 @@
2
2
  import BaseBlock from "./BaseBlock.vue";
3
3
  import { useFocusHub } from "jsview";
4
4
 
5
- defineProps({
5
+ const props=defineProps({
6
6
  name: String,
7
7
  style: {
8
8
  type: Object,
@@ -23,5 +23,5 @@ const onKeyDown = (ev) => {
23
23
  </script>
24
24
 
25
25
  <template>
26
- <BaseBlock :name="name" :style="style" :onKeyDown="onKeyDown" />
26
+ <BaseBlock :name="props.name" :style="props.style" :onKeyDown="onKeyDown" />
27
27
  </template>
@@ -1,70 +1,59 @@
1
- <script>
1
+ <script setup>
2
2
  import ScssApp from './Scss/App.vue';
3
3
  import LessApp from './Less/App.vue';
4
4
  import StylusApp from './Stylus/App.vue';
5
+ import { useRouter } from "vue-router";
6
+ import { reactive } from "vue"
7
+ const router = useRouter();
8
+ const panelInfo = reactive({
9
+ index: 1,
10
+ total: 3,
11
+ desc: "1/3",
12
+ })
13
+ const onKeyDown = (ev) => {
14
+ console.log('onKeyDown');
15
+ // 8:Backspace, 27:Escape, 10000:盒子返回键
16
+ if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
17
+ console.log("Basic has router: ", !!router)
18
+ router?.go(-1); // 有router时,是从DemoHomepage进入,回退
19
+ return true;
20
+ } else if (ev.keyCode == 37) { // left
21
+ panelInfo.index = (--panelInfo.index > 1 ? panelInfo.index : 1);
22
+ panelInfo.desc = (panelInfo.index + '/' + panelInfo.total);
23
+ return true;
24
+ } else if (ev.keyCode == 39) { // right
25
+ panelInfo.index = (++panelInfo.index < panelInfo.total ? panelInfo.index : panelInfo.total);
26
+ panelInfo.desc = (panelInfo.index + '/' + panelInfo.total);
27
+ return true;
28
+ }
5
29
 
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
- },
30
+ return false;
44
31
  }
32
+ const actionDefines = {
33
+ onKeyDown
34
+ }
45
35
  </script>
46
36
 
47
37
  <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}">
38
+ <div>
39
+ <!-- 有router时,将按键交给router去处理,此处没有其他用处 -->
40
+ <jsv-focus-block autoFocus :onAction="actionDefines" />
41
+ <div class="root">
42
+ <ScssApp v-if="panelInfo.index == 1" />
43
+ <LessApp v-else-if="panelInfo.index == 2" />
44
+ <StylusApp v-else-if="panelInfo.index == 3" />
45
+ <div :style="{ top: 660, left: 30, width: 50 }">
57
46
  {{ panelInfo.desc }}
58
47
  </div>
59
- <div :style="{top: 660, left:100, width:500}">
48
+ <div :style="{ top: 660, left: 100, width: 500 }">
60
49
  按左/右键切换Panel,按Back键返回
61
50
  </div>
51
+ </div>
62
52
  </div>
63
- </div>
64
53
  </template>
65
54
 
66
55
  <style scoped>
67
56
  .root {
68
- color: #0000FF;
57
+ color: #FF0000;
69
58
  }
70
59
  </style>
@@ -1,32 +1,24 @@
1
- <script>
1
+ <script setup>
2
2
  import { panelData } from './PanelData';
3
3
  import Panel from '../utils/Panel.vue';
4
4
 
5
- export default {
6
- components: {
7
- Panel
8
- },
9
- setup() {
10
- return {
11
- panelData,
12
- };
13
- },
14
- }
15
5
  </script>
16
6
 
17
7
  <template>
18
8
  <div>
19
9
  <div class="root">
20
10
  <Panel :style="{top:10, left:10, width:1230, height:640}"
21
- :panelData=panelData :sideline=true />
11
+ :panelData="panelData" :sideline="true" />
22
12
  </div>
23
13
  </div>
24
14
  </template>
25
15
 
26
16
  <style scoped>
27
17
  .root {
28
- top: 10; left: 10;
29
- width: 1250; height: 670;
18
+ top: 10;
19
+ left: 10;
20
+ width: 1250;
21
+ height: 670;
30
22
  background-color: #d6e1ce
31
23
  }
32
24
  </style>
@@ -1,32 +1,24 @@
1
- <script>
1
+ <script setup>
2
2
  import { panelData } from './PanelData';
3
3
  import Panel from '../utils/Panel.vue';
4
4
 
5
- export default {
6
- components: {
7
- Panel
8
- },
9
- setup() {
10
- return {
11
- panelData,
12
- };
13
- },
14
- }
15
5
  </script>
16
6
 
17
7
  <template>
18
8
  <div>
19
9
  <div class="root">
20
10
  <Panel :style="{top:10, left:10, width:1230, height:640}"
21
- :panelData=panelData :sideline=true />
11
+ :panelData="panelData" :sideline="true" />
22
12
  </div>
23
13
  </div>
24
14
  </template>
25
15
 
26
16
  <style scoped>
27
17
  .root {
28
- top: 10; left: 10;
29
- width: 1250; height: 670;
18
+ top: 10;
19
+ left: 10;
20
+ width: 1250;
21
+ height: 670;
30
22
  background-color: #d6e1ce
31
23
  }
32
24
  </style>
@@ -21,7 +21,6 @@ export default {
21
21
  .scss-op {
22
22
  color: #126085; /* 不支持乘法样例 如:color: #001100 * 16 */
23
23
  font-size: 20 - 6; /* 此处为运算符'-'样例 */
24
-
25
24
  left: 10;
26
25
  top: 3;
27
26
  width: 230;
@@ -1,32 +1,24 @@
1
- <script>
1
+ <script setup>
2
2
  import { panelData } from './PanelData';
3
3
  import Panel from '../utils/Panel.vue';
4
4
 
5
- export default {
6
- components: {
7
- Panel
8
- },
9
- setup() {
10
- return {
11
- panelData,
12
- };
13
- },
14
- }
15
5
  </script>
16
6
 
17
7
  <template>
18
8
  <div>
19
9
  <div class="root">
20
10
  <Panel :style="{top:10, left:10, width:1230, height:640}"
21
- :panelData=panelData :sideline=true />
11
+ :panelData="panelData" :sideline="true" />
22
12
  </div>
23
13
  </div>
24
14
  </template>
25
15
 
26
16
  <style scoped>
27
17
  .root {
28
- top: 10; left: 10;
29
- width: 1250; height: 670;
18
+ top: 10;
19
+ left: 10;
20
+ width: 1250;
21
+ height: 670;
30
22
  background-color: #d6e1ce
31
23
  }
32
24
  </style>
@@ -1,6 +1,6 @@
1
- <script>
2
-
3
- export default {
1
+ <script setup>
2
+ import { computed } from "vue"
3
+ /* export default {
4
4
  props: {
5
5
  index: Number,
6
6
  style: Object,
@@ -22,21 +22,39 @@ export default {
22
22
  }
23
23
  }
24
24
 
25
+ } */
26
+ const props = defineProps({
27
+ index: Number,
28
+ style: Object,
29
+ title: String,
30
+ })
31
+
32
+ const blockOpacity = computed(() => {
33
+ return 0.4 * ((props.index % 3) + 1) / 3;
34
+ })
35
+
36
+ const titleStyle = {
37
+ lineHeight: 18,
38
+ width: props.style.width, height: 18,
39
+ backgroundColor: 'rgba(142,175,153,1)',
40
+ textAlign: 'center'
25
41
  }
26
42
 
27
43
  </script>
28
44
 
29
45
  <template>
30
- <div :style=style>
31
- <div class="container-font" :style=titleStyle>
32
- {{title}}
33
- </div>
34
- <div class="content-font" :style="{ top: titleStyle.lineHeight,
35
- width: style.width, height: style.height - 18,
36
- backgroundColor: 'rgba(0,0,0,'+blockOpacity+')' }">
37
- <slot/>
46
+ <div :style=props.style>
47
+ <div class="container-font" :style=titleStyle>
48
+ {{ title }}
49
+ </div>
50
+ <div class="content-font" :style="{
51
+ top: titleStyle.lineHeight,
52
+ width: props.style.width, height: props.style.height - 18,
53
+ backgroundColor: 'rgba(0,0,0,' + blockOpacity + ')'
54
+ }">
55
+ <slot />
56
+ </div>
38
57
  </div>
39
- </div>
40
58
  </template>
41
59
 
42
60
  <style>