@shijiu/jsview-vue-samples 2.3.0 → 2.3.151-test.0
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/DashPath/App.vue +17 -16
- package/DashPath/AppForOperator.vue +2 -4
- package/DemoForOperator/AnimPic/AnimPic.vue +24 -2
- package/DemoForOperator/Banger/Banger/Banger.vue +73 -9
- package/DemoForOperator/Blur/Blur.vue +146 -0
- package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +158 -0
- package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +162 -0
- package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +113 -0
- package/DemoForOperator/BookFlip/App.vue +115 -0
- package/DemoForOperator/BookFlip/BookFlip/FlipPage.vue +179 -0
- package/DemoForOperator/BookFlip/BookFlip/FlippingBook.vue +310 -0
- package/DemoForOperator/BookFlip/BookFlip/flip.glsl +135 -0
- package/DemoForOperator/BookFlip/BookPage.vue +82 -0
- package/DemoForOperator/Bounce/Bounce.vue +33 -1
- package/DemoForOperator/ChunLian/Couplets.vue +44 -1
- package/DemoForOperator/ClickSpriteAnim/App.vue +130 -0
- package/DemoForOperator/ClickSpriteAnim/Item.vue +74 -0
- package/DemoForOperator/DominantColor/App.vue +187 -0
- package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +0 -3
- package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +76 -2
- package/DemoForOperator/Firework1/App.vue +1 -1
- package/DemoForOperator/Firework1/Fireworks.vue +50 -11
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +29 -1
- package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +27 -2
- package/DemoForOperator/Focus/Light/LightFocusBox.vue +42 -1
- package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +12 -0
- package/DemoForOperator/FrameShadow/App.vue +193 -0
- package/DemoForOperator/FrameShadow/FrameShadow.vue +61 -0
- package/DemoForOperator/FullscreenIn/App.vue +1 -1
- package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +18 -3
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +60 -18
- package/DemoForOperator/GrayFilter/GrayFilter.vue +21 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +46 -4
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +34 -2
- package/DemoForOperator/LongChatBox/App.vue +36 -0
- package/DemoForOperator/LongChatBox/Bubble.vue +104 -0
- package/DemoForOperator/LongChatBox/LongChat.vue +173 -0
- package/DemoForOperator/LongChatBox/TextManager.ts +147 -0
- package/DemoForOperator/LongChatBox/VirtualList.vue +298 -0
- package/DemoForOperator/LongChatBox/testData.js +51 -0
- package/DemoForOperator/LongChatBox/utile.js +331 -0
- package/DemoForOperator/Particle/Drop/DropParticle.vue +33 -1
- package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +23 -2
- package/DemoForOperator/PosterAnim/PosterAnim.js +21 -0
- package/DemoForOperator/PosterOverflow/PosterOverflow.vue +16 -0
- package/DemoForOperator/Resize/App.vue +157 -0
- package/DemoForOperator/Resize/Resize/Item.vue +234 -0
- package/DemoForOperator/Resize/Resize/Resize.vue +96 -0
- package/DemoForOperator/Ripple/Ripple.vue +16 -1
- package/DemoForOperator/ScreenShootScale/App.vue +96 -0
- package/DemoForOperator/ScreenShootScale/Back.vue +86 -0
- package/DemoForOperator/ScreenShootScale/Front.vue +133 -0
- package/DemoForOperator/ScreenShootScale/Item.vue +62 -0
- package/DemoForOperator/ScreenShootScale/ScreenShootScale.vue +109 -0
- package/DemoForOperator/SmoothSwiper/App.vue +50 -0
- package/DemoForOperator/Sound/Bounce/App.vue +56 -0
- package/DemoForOperator/Sound/Bounce/Bounce.vue +87 -0
- package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +146 -0
- package/DemoForOperator/Sound/Bounce/bgmusic.mp3 +0 -0
- package/DemoForOperator/Sound/Bounce/coin.mp3 +0 -0
- package/DemoForOperator/Sound/FocusMove/App.vue +134 -0
- package/DemoForOperator/Sound/FocusMove/Item.vue +43 -0
- package/DemoForOperator/Sound/FocusMove/move.mp3 +0 -0
- package/DemoForOperator/Sound/Rain/App.vue +11 -0
- package/DemoForOperator/Sound/Rain/Raining/Rain.vue +69 -0
- package/DemoForOperator/Sound/Rain/Raining/RainScene.vue +118 -0
- package/DemoForOperator/Sound/Sound/Sound.vue +24 -0
- package/DemoForOperator/Sound/Sound/index.js +4 -0
- package/DemoForOperator/Sound/Sound/useSound.js +112 -0
- package/DemoForOperator/Sprite/Sprite.vue +62 -5
- package/DemoForOperator/Stretch/Stretch/Stretch.vue +52 -2
- package/DemoForOperator/Swiper/App.vue +101 -0
- package/DemoForOperator/Swiper/Item.vue +56 -0
- package/DemoForOperator/Swiper/ParallaxSlide.vue +164 -0
- package/DemoForOperator/TabContent/TabContent/TabContent.vue +39 -1
- package/DemoForOperator/TabContentVertical/App.vue +104 -0
- package/DemoForOperator/TabContentVertical/ContentPage.vue +67 -0
- package/DemoForOperator/TabContentVertical/Item.vue +94 -0
- package/DemoForOperator/TabContentVertical/PageItem.vue +40 -0
- package/DemoForOperator/TabContentVertical/TabContent/CreepFocus.vue +160 -0
- package/DemoForOperator/TabContentVertical/TabContent/Item.vue +63 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabContent.vue +184 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabItem.vue +368 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabWidget.vue +259 -0
- package/DemoForOperator/TabContentVertical/TabContent/Util.js +3 -0
- package/DemoForOperator/TabContentVertical/TabContent/ViewSwiper.vue +110 -0
- package/DemoForOperator/TabContentVertical/assets/children_science.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/documentary.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/free.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/game.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/home_selected.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/movie_ticket.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/my_account.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/opera.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/sports.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/tv_drama.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/variety_show.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/vip.png +0 -0
- package/DemoForOperator/TabContentVertical/testData.js +76 -0
- package/DemoForOperator/Vortex/Vortex/Vortex.vue +26 -0
- package/DemoForOperator/routeList.js +118 -1
- package/DemoHomepage/components/Item.vue +11 -0
- package/DemoHomepage/router.js +75 -1
- package/GiftRain/components/SpriteTranslate.vue +68 -48
- package/HashHistory/App.vue +2 -2
- package/HashHistory/router.js +1 -1
- package/MetroWidgetDemos/TripleWidget/App.vue +7 -1
- package/MetroWidgetDemos/TripleWidget/Item.vue +16 -2
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +7 -1
- package/MetroWidgetDemos/TripleWidget/WidgetItem.vue +8 -2
- package/MetroWidgetDemos/routeList.js +17 -0
- package/PosterPacker/App.vue +2 -2
- package/ViewOpacity/App.vue +19 -0
- package/package.json +1 -1
- package/DashPath/DashPath.vue +0 -118
- package/DemoForOperator/ScalePoster/App.vue +0 -4
- package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
|
@@ -7,6 +7,7 @@ const props = defineProps({
|
|
|
7
7
|
data: Object,
|
|
8
8
|
onAction: Object,
|
|
9
9
|
onItemEdge: Function,
|
|
10
|
+
queryInfo: Object,
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
const focusHub = useFocusHub();
|
|
@@ -87,7 +88,12 @@ props.onAction.register("onFocus", onFocus);
|
|
|
87
88
|
>
|
|
88
89
|
<!-- 重要代码: 为了实现焦点就近移动, 需要传递onItemEdge回调 -->
|
|
89
90
|
<template #renderItem="{ data, onAction, onItemEdge }">
|
|
90
|
-
<widget-item
|
|
91
|
+
<widget-item
|
|
92
|
+
:data="data"
|
|
93
|
+
:onAction="onAction"
|
|
94
|
+
:onItemEdge="onItemEdge"
|
|
95
|
+
:rowNum="props.queryInfo.id"
|
|
96
|
+
/>
|
|
91
97
|
</template>
|
|
92
98
|
</metro-widget>
|
|
93
99
|
</template>
|
|
@@ -7,6 +7,7 @@ const props = defineProps({
|
|
|
7
7
|
data: Object,
|
|
8
8
|
onItemEdge: Function,
|
|
9
9
|
onAction: Object,
|
|
10
|
+
rowNum: Object,
|
|
10
11
|
});
|
|
11
12
|
const focusHub = useFocusHub();
|
|
12
13
|
const mwRef = shallowRef(null);
|
|
@@ -104,8 +105,13 @@ props.onAction.register("onBlur", onBlur);
|
|
|
104
105
|
:onEdge="onItemEdge"
|
|
105
106
|
:sendFocusRectEvent="true"
|
|
106
107
|
>
|
|
107
|
-
<template #renderItem="{ data, onAction }">
|
|
108
|
-
<item
|
|
108
|
+
<template #renderItem="{ data, onAction, query }">
|
|
109
|
+
<item
|
|
110
|
+
:data="data"
|
|
111
|
+
:onAction="onAction"
|
|
112
|
+
:rowNum="props.rowNum"
|
|
113
|
+
:queryInfo="query"
|
|
114
|
+
/>
|
|
109
115
|
</template>
|
|
110
116
|
</metro-widget>
|
|
111
117
|
</template>
|
|
@@ -6,94 +6,111 @@
|
|
|
6
6
|
export default [
|
|
7
7
|
{
|
|
8
8
|
meta: { nameText: "基础示例", },
|
|
9
|
+
name: "metroWidget-基础示例",
|
|
9
10
|
path: "/metroWidget/basic",
|
|
10
11
|
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/basic/App.vue"),
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
14
|
meta: { nameText: "direction", },
|
|
15
|
+
name: "metroWidget-direction",
|
|
14
16
|
path: "/metroWidget/direction",
|
|
15
17
|
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/direction/App.vue"),
|
|
16
18
|
},
|
|
17
19
|
{
|
|
18
20
|
meta: { nameText: "padding", },
|
|
21
|
+
name: "metroWidget-padding",
|
|
19
22
|
path: "/metroWidget/padding",
|
|
20
23
|
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/padding/App.vue"),
|
|
21
24
|
},
|
|
22
25
|
{
|
|
23
26
|
meta: { nameText: "slideSetting", },
|
|
27
|
+
name: "metroWidget-slideSetting",
|
|
24
28
|
path: "/metroWidget/slideSetting",
|
|
25
29
|
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/slideSetting/App.vue"),
|
|
26
30
|
},
|
|
27
31
|
{
|
|
28
32
|
meta: { nameText: "layoutType", },
|
|
33
|
+
name: "metroWidget-layoutType",
|
|
29
34
|
path: "/metroWidget/layoutType",
|
|
30
35
|
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/layoutType/App.vue"),
|
|
31
36
|
},
|
|
32
37
|
{
|
|
33
38
|
meta: { nameText: "嵌套(基础)", },
|
|
39
|
+
name: "metroWidget-嵌套(基础)",
|
|
34
40
|
path: "/metroWidget/focusableItemBasic",
|
|
35
41
|
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/focusableItemBasic/App.vue"),
|
|
36
42
|
},
|
|
37
43
|
{
|
|
38
44
|
meta: { nameText: "嵌套(混合)", },
|
|
45
|
+
name: "metroWidget-嵌套(混合)",
|
|
39
46
|
path: "/metroWidget/focusableItemMix",
|
|
40
47
|
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/focusableItemMix/App.vue"),
|
|
41
48
|
},
|
|
42
49
|
{
|
|
43
50
|
meta: { nameText: "嵌套(MetroWidget)", },
|
|
51
|
+
name: "metroWidget-嵌套(MetroWidget)",
|
|
44
52
|
path: "/metroWidget/focusableItemMetroWidget",
|
|
45
53
|
component: () => import("@shijiu/jsview-vue-samples/MetroWidgetDemos/focusableItemMetroWidget/App.vue"),
|
|
46
54
|
},
|
|
47
55
|
{
|
|
48
56
|
meta: { nameText: "乒乓模式", },
|
|
57
|
+
name: "metroWidget-乒乓模式",
|
|
49
58
|
path: "/metroWidget/PingPong",
|
|
50
59
|
component: () =>
|
|
51
60
|
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/PingPong/App.vue"),
|
|
52
61
|
},
|
|
53
62
|
{
|
|
54
63
|
meta: { nameText: "性能测试", },
|
|
64
|
+
name: "metroWidget-性能测试",
|
|
55
65
|
path: "/metroWidget/PerformanceTest",
|
|
56
66
|
component: () =>
|
|
57
67
|
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/PerformanceTest/App.vue"),
|
|
58
68
|
},
|
|
59
69
|
{
|
|
60
70
|
meta: { nameText: "骨架图", },
|
|
71
|
+
name: "metroWidget-骨架图",
|
|
61
72
|
path: "/metroWidget/SkeletonDiagram",
|
|
62
73
|
component: () =>
|
|
63
74
|
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/SkeletonDiagram/App.vue"),
|
|
64
75
|
},
|
|
65
76
|
{
|
|
66
77
|
meta: { nameText: ".9焦点页面", },
|
|
78
|
+
name: "metroWidget-.9焦点页面",
|
|
67
79
|
path: "/metroWidget/ninePatchFocusPage",
|
|
68
80
|
component: () =>
|
|
69
81
|
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/ninePatchFocusPage/App.vue"),
|
|
70
82
|
},
|
|
71
83
|
{
|
|
72
84
|
meta: { nameText: "item尺寸更新", },
|
|
85
|
+
name: "metroWidget-item尺寸更新",
|
|
73
86
|
path: "/metroWidget/itemSizeUpdate",
|
|
74
87
|
component: () =>
|
|
75
88
|
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/itemSizeUpdate/App.vue"),
|
|
76
89
|
},
|
|
77
90
|
{
|
|
78
91
|
meta: { nameText: "三层嵌套", },
|
|
92
|
+
name: "metroWidget-三层嵌套",
|
|
79
93
|
path: "/metroWidget/TripleWidget",
|
|
80
94
|
component: () =>
|
|
81
95
|
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/TripleWidget/App.vue"),
|
|
82
96
|
},
|
|
83
97
|
{
|
|
84
98
|
meta: { nameText: "数据刷新demo", },
|
|
99
|
+
name: "metroWidget-数据刷新demo",
|
|
85
100
|
path: "/metroWidget/RefreshDemo",
|
|
86
101
|
component: () =>
|
|
87
102
|
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/RefreshDemo/App.vue"),
|
|
88
103
|
},
|
|
89
104
|
{
|
|
90
105
|
meta: { nameText: "剧集翻页", },
|
|
106
|
+
name: "metroWidget-剧集翻页",
|
|
91
107
|
path: "/metroWidget/SeamlessSlide",
|
|
92
108
|
component: () =>
|
|
93
109
|
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/SeamlessSlide/App.vue"),
|
|
94
110
|
},
|
|
95
111
|
{
|
|
96
112
|
meta: { nameText: "多item分段显示", },
|
|
113
|
+
name: "metroWidget-多item分段显示",
|
|
97
114
|
path: "/metroWidget/MassiveItems",
|
|
98
115
|
component: () =>
|
|
99
116
|
import("@shijiu/jsview-vue-samples/MetroWidgetDemos/MassiveItems/App.vue"),
|
package/PosterPacker/App.vue
CHANGED
|
@@ -79,9 +79,9 @@ const onKeyDown = (ev) => {
|
|
|
79
79
|
}
|
|
80
80
|
case 13: {
|
|
81
81
|
if (rKeyCount.value == 0) {
|
|
82
|
-
cChildRef1.value
|
|
82
|
+
cChildRef1.value?.getRandomDecimal();
|
|
83
83
|
} else {
|
|
84
|
-
cChildRef2.value
|
|
84
|
+
cChildRef2.value?.switcher();
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
return true;
|
package/ViewOpacity/App.vue
CHANGED
|
@@ -81,6 +81,25 @@ onUnmounted(() => {
|
|
|
81
81
|
/>
|
|
82
82
|
</div>
|
|
83
83
|
</div>
|
|
84
|
+
<div class="block">
|
|
85
|
+
<div :style="{ left: 120, top: 320 }">
|
|
86
|
+
<img
|
|
87
|
+
:style="{
|
|
88
|
+
...style1,
|
|
89
|
+
}"
|
|
90
|
+
:src="test1"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div :style="{ left: 500, top: 320 }">
|
|
95
|
+
<img
|
|
96
|
+
:style="{
|
|
97
|
+
...style1,
|
|
98
|
+
}"
|
|
99
|
+
:src="test2"
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
84
103
|
</div>
|
|
85
104
|
</jsv-focus-block>
|
|
86
105
|
</template>
|
package/package.json
CHANGED
package/DashPath/DashPath.vue
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :style="{ ...layout, backgroundImage: `url(jsvtexturestore://${sourceId})` }" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script setup>
|
|
6
|
-
import { JsvTextureStoreApi } from "jsview";
|
|
7
|
-
import { onBeforeUnmount, computed } from "vue";
|
|
8
|
-
|
|
9
|
-
const props = defineProps({
|
|
10
|
-
// 点数组,每个点包含 x 和 y 坐标
|
|
11
|
-
points: {
|
|
12
|
-
type: Array,
|
|
13
|
-
required: true,
|
|
14
|
-
validator: (value) => {
|
|
15
|
-
return value.every(point => 'x' in point && 'y' in point);
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
// 虚线配置,例如 [10, 5] 表示10px实线,5px空白
|
|
19
|
-
dash: {
|
|
20
|
-
type: Array,
|
|
21
|
-
default: () => [10, 10]
|
|
22
|
-
},
|
|
23
|
-
// 虚线起始位置偏移
|
|
24
|
-
phase: {
|
|
25
|
-
type: Number,
|
|
26
|
-
default: 0
|
|
27
|
-
},
|
|
28
|
-
// 线条颜色
|
|
29
|
-
color: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: "#FFFFFF"
|
|
32
|
-
},
|
|
33
|
-
// 线条宽度
|
|
34
|
-
lineWidth: {
|
|
35
|
-
type: Number,
|
|
36
|
-
default: 2
|
|
37
|
-
},
|
|
38
|
-
// 布局样式
|
|
39
|
-
layout: {
|
|
40
|
-
type: Object,
|
|
41
|
-
required: true
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// 计算坐标系调整值和画布尺寸
|
|
46
|
-
const canvasInfo = computed(() => {
|
|
47
|
-
const xValues = props.points.map(p => p.x);
|
|
48
|
-
const yValues = props.points.map(p => p.y);
|
|
49
|
-
|
|
50
|
-
// 找出最小坐标值
|
|
51
|
-
const minX = Math.min(...xValues);
|
|
52
|
-
const minY = Math.min(...yValues);
|
|
53
|
-
|
|
54
|
-
// 计算偏移量(考虑线宽)
|
|
55
|
-
const offsetX = minX < 0 ? Math.abs(minX) : 0;
|
|
56
|
-
const offsetY = minY < 0 ? Math.abs(minY) : 0;
|
|
57
|
-
const lineOffset = Math.ceil(props.lineWidth / 2);
|
|
58
|
-
|
|
59
|
-
// 计算画布尺寸(考虑线宽)
|
|
60
|
-
const width = Math.max(...xValues) - minX + props.lineWidth * 2;
|
|
61
|
-
const height = Math.max(...yValues) - minY + props.lineWidth * 2;
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
offsetX: offsetX + lineOffset,
|
|
65
|
-
offsetY: offsetY + lineOffset,
|
|
66
|
-
width,
|
|
67
|
-
height
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// 创建画布纹理
|
|
72
|
-
let sourceId = '';
|
|
73
|
-
const canvasRef = JsvTextureStoreApi.canvasTexture(
|
|
74
|
-
canvasInfo.value.width,
|
|
75
|
-
canvasInfo.value.height
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
// 绘制透明背景
|
|
79
|
-
canvasRef.drawColor("rgba(0,0,0,0)");
|
|
80
|
-
|
|
81
|
-
// 创建自定义路径
|
|
82
|
-
const path = canvasRef.customPath();
|
|
83
|
-
|
|
84
|
-
// 移动到第一个调整后的点
|
|
85
|
-
if (props.points.length > 0) {
|
|
86
|
-
const firstPoint = props.points[0];
|
|
87
|
-
path.moveTo(
|
|
88
|
-
firstPoint.x + canvasInfo.value.offsetX,
|
|
89
|
-
firstPoint.y + canvasInfo.value.offsetY
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
// 连接后续的调整后的点
|
|
93
|
-
for (let i = 1; i < props.points.length; i++) {
|
|
94
|
-
const point = props.points[i];
|
|
95
|
-
path.lineTo(
|
|
96
|
-
point.x + canvasInfo.value.offsetX,
|
|
97
|
-
point.y + canvasInfo.value.offsetY
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
path.close();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// 使用虚线样式绘制路径
|
|
104
|
-
path.strokeWithSetting({
|
|
105
|
-
lineWidth: props.lineWidth,
|
|
106
|
-
color: props.color,
|
|
107
|
-
dash: props.dash,
|
|
108
|
-
phase: props.phase
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// 提交纹理并获取sourceId
|
|
112
|
-
sourceId = canvasRef.commit();
|
|
113
|
-
|
|
114
|
-
// 组件卸载时清理纹理
|
|
115
|
-
onBeforeUnmount(() => {
|
|
116
|
-
JsvTextureStoreApi.deleteTexture(sourceId);
|
|
117
|
-
});
|
|
118
|
-
</script>
|
|
File without changes
|