@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.
- package/Basic/components/div/DivBackground.vue +13 -25
- package/Basic/components/img/ImageGroup.vue +14 -20
- package/Basic/components/img/ImgLayout.vue +59 -68
- package/BasicFocusControl/components/BaseBlock.vue +11 -17
- package/BasicFocusControl/components/MainAreaLeftBlock.vue +2 -2
- package/BasicFocusControl/components/MainAreaRightBlock.vue +2 -2
- package/BasicFocusControl/components/SideBarBlock.vue +2 -2
- package/CssPreprocessor/App.vue +40 -51
- package/CssPreprocessor/Less/App.vue +6 -14
- package/CssPreprocessor/Scss/App.vue +6 -14
- package/CssPreprocessor/Scss/components/scss-group1/ScssOperations.vue +0 -1
- package/CssPreprocessor/Stylus/App.vue +6 -14
- package/CssPreprocessor/utils/ContentBlock.vue +30 -12
- package/CssPreprocessor/utils/ContentList.vue +23 -14
- package/CssPreprocessor/utils/Panel.vue +34 -23
- package/CssPreprocessor/utils/TitleBar.vue +7 -9
- package/DemoHomepage/components/BodyFrame.vue +54 -78
- package/DemoHomepage/components/Dialog.vue +38 -43
- package/DemoHomepage/components/Item.vue +52 -55
- package/DemoHomepage/components/TabFrame.vue +43 -72
- package/DemoHomepage/router.js +1 -1
- package/GiftRain/App.vue +10 -4
- package/GridDemo/App.vue +5 -5
- package/GridDemo/FocusItem.vue +3 -5
- package/GridDemo/Item.vue +4 -24
- package/HashHistory/App.vue +0 -10
- package/HashHistory/views/MainPage.vue +0 -1
- package/ImpactStop/App.vue +0 -1
- package/Input/App.vue +106 -150
- package/Input/FullKeyboard.vue +18 -28
- package/Input/InputPanel.vue +87 -109
- package/Input/KeyboardItem.vue +35 -45
- package/JsvRadarChart/App.vue +16 -19
- package/LongImage/Button.vue +2 -3
- package/LongText/App.vue +0 -3
- package/LongText/Button.vue +0 -1
- package/LongText/LongTextScroll.vue +0 -4
- package/Marquee/App.vue +1 -0
- package/MetroWidgetDemos/PerformanceTest/App.vue +2 -3
- package/MetroWidgetDemos/PerformanceTest/Item.vue +52 -55
- package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +26 -26
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +86 -95
- package/MetroWidgetDemos/PingPong/App.vue +56 -89
- package/MetroWidgetDemos/PingPong/AppPage.vue +3 -3
- package/MetroWidgetDemos/PingPong/Item.vue +1 -1
- package/MetroWidgetDemos/PingPong/TabItem.vue +3 -3
- package/MetroWidgetDemos/PingPong/WidgetItem.vue +1 -1
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +2 -4
- package/MetroWidgetDemos/basic/Item.vue +1 -1
- package/MetroWidgetDemos/direction/App.vue +0 -2
- package/MetroWidgetDemos/direction/Item.vue +1 -1
- package/MetroWidgetDemos/focusableItemBasic/App.vue +1 -1
- package/MetroWidgetDemos/focusableItemBasic/ButtonItem.vue +1 -1
- package/MetroWidgetDemos/focusableItemMetroWidget/App.vue +1 -1
- package/MetroWidgetDemos/focusableItemMetroWidget/Item.vue +1 -1
- package/MetroWidgetDemos/focusableItemMetroWidget/WidgetItem.vue +1 -1
- package/MetroWidgetDemos/focusableItemMix/App.vue +1 -1
- package/MetroWidgetDemos/focusableItemMix/ButtonItem.vue +1 -1
- package/MetroWidgetDemos/focusableItemMix/Item.vue +1 -1
- package/MetroWidgetDemos/itemSizeUpdate/backward/Item.vue +23 -25
- package/MetroWidgetDemos/layoutType/App.vue +0 -2
- package/MetroWidgetDemos/layoutType/Item.vue +1 -1
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +0 -1
- package/MetroWidgetDemos/ninePatchFocusPage/PageRow.vue +1 -1
- package/MetroWidgetDemos/padding/App.vue +0 -2
- package/MetroWidgetDemos/padding/Item.vue +1 -1
- package/MetroWidgetDemos/slideSetting/Item.vue +1 -1
- package/MockjsDemo/App.vue +26 -11
- package/MockjsDemo/mock/index.js +9 -1
- package/QrcodeDemo/App.vue +0 -1
- package/SoundPool/App.vue +1 -2
- package/SpriteImage/App.vue +89 -125
- package/Swiper/App.vue +1 -3
- package/TestNativeSharedView/App.vue +104 -48
- package/TextBox/RenderCenter.vue +89 -113
- package/TextBox/RenderLeft.vue +89 -113
- package/TextBox/RenderOneLine.vue +7 -10
- package/TextBox/RenderRight.vue +8 -11
- package/TextShadowDemo/App.vue +54 -75
- package/TextureAnimation/App.vue +175 -287
- package/TextureAnimation/App2.vue +1 -5
- package/ThrowMoveDemo/AccelerateDemo.vue +40 -71
- package/ThrowMoveDemo/App.vue +13 -23
- package/ThrowMoveDemo/TargetDemo.vue +24 -53
- package/ThrowMoveDemo/UDParabolicDemo.vue +31 -60
- package/VideoDemo/App.vue +71 -116
- package/package.json +1 -1
- package/VideoDemo/components/Button.vue +0 -58
- package/VideoDemo/components/Controllor.vue +0 -197
- 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
|
-
|
|
9
|
-
:
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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
|
|
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
|
|
4
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
|
59
|
-
import
|
|
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;
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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>
|
package/CssPreprocessor/App.vue
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
<
|
|
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: #
|
|
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;
|
|
29
|
-
|
|
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;
|
|
29
|
-
|
|
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;
|
|
29
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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>
|