@shijiu/jsview-vue-samples 2.1.476-test.0 → 2.1.482-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/DemoHomepage/components/BodyFrame.vue +2 -0
- package/DemoHomepage/components/Item.vue +1 -0
- package/DemoHomepage/components/TabFrame.vue +25 -7
- package/DemoHomepage/router.js +7 -1
- package/DemoHomepage/views/Homepage.vue +9 -0
- package/TouchWidget/App.vue +2 -2
- package/TouchWidget/Item.vue +1 -1
- package/TouchWidget/WidgetItem.vue +4 -1
- package/package.json +1 -1
|
@@ -22,6 +22,7 @@ const measures = (item) => {
|
|
|
22
22
|
width: item.width,
|
|
23
23
|
height: item.height,
|
|
24
24
|
focusable: item.focusable,
|
|
25
|
+
enableTap: true,
|
|
25
26
|
};
|
|
26
27
|
};
|
|
27
28
|
|
|
@@ -65,6 +66,7 @@ watch(
|
|
|
65
66
|
:padding="{ left: 10, top: 10, right: 10, bottom: 10 }"
|
|
66
67
|
:onEdge="props.onEdge"
|
|
67
68
|
:initFocusId="initFocusId"
|
|
69
|
+
:touchFlag="1"
|
|
68
70
|
>
|
|
69
71
|
<template #renderItem="{ data, query, onEdge, onAction }">
|
|
70
72
|
<Item
|
|
@@ -7,15 +7,17 @@ const measures = (item) => {
|
|
|
7
7
|
width: item.width,
|
|
8
8
|
height: item.height,
|
|
9
9
|
focusable: item.focusable,
|
|
10
|
+
enableTap: true,
|
|
10
11
|
};
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
const props = defineProps({
|
|
14
15
|
name: String,
|
|
15
16
|
itemFocus: Function,
|
|
17
|
+
itemClick: Function,
|
|
16
18
|
onEdge: Function,
|
|
17
19
|
initId: Number,
|
|
18
|
-
})
|
|
20
|
+
});
|
|
19
21
|
|
|
20
22
|
const width = 1280;
|
|
21
23
|
const height = 100;
|
|
@@ -47,22 +49,38 @@ const data = [
|
|
|
47
49
|
name: "游戏实例",
|
|
48
50
|
focusable: true,
|
|
49
51
|
id: 3,
|
|
50
|
-
}
|
|
52
|
+
},
|
|
51
53
|
];
|
|
52
54
|
const direction = VERTICAL;
|
|
53
|
-
|
|
54
55
|
</script>
|
|
55
56
|
|
|
56
57
|
<template>
|
|
57
|
-
<metro-widget
|
|
58
|
-
:
|
|
58
|
+
<metro-widget
|
|
59
|
+
:name="props.name"
|
|
60
|
+
:width="width"
|
|
61
|
+
:height="height"
|
|
62
|
+
:direction="direction"
|
|
63
|
+
:data="data"
|
|
64
|
+
:measures="measures"
|
|
65
|
+
:padding="{ left: 10, top: 10, right: 10, bottom: 10 }"
|
|
66
|
+
:onEdge="props.onEdge"
|
|
67
|
+
:initFocusId="props.initId"
|
|
68
|
+
>
|
|
59
69
|
<template #renderItem="{ data, query, onEdge, onAction }">
|
|
60
|
-
<Item
|
|
70
|
+
<Item
|
|
71
|
+
:style="{
|
|
61
72
|
width: data.width,
|
|
62
73
|
height: data.height,
|
|
63
74
|
backgroundColor: '#00AA00',
|
|
64
75
|
color: '#FFFFFF',
|
|
65
|
-
}"
|
|
76
|
+
}"
|
|
77
|
+
:data="data"
|
|
78
|
+
:query="query"
|
|
79
|
+
:onEdge="onEdge"
|
|
80
|
+
:onAction="onAction"
|
|
81
|
+
:itemFocus="props.itemFocus"
|
|
82
|
+
:itemClick="props.itemClick"
|
|
83
|
+
>
|
|
66
84
|
{{ data.name }}
|
|
67
85
|
</Item>
|
|
68
86
|
</template>
|
package/DemoHomepage/router.js
CHANGED
|
@@ -298,7 +298,13 @@ let routeList = [
|
|
|
298
298
|
name: 'latex公式',
|
|
299
299
|
path: '/feature/LatexFormula',
|
|
300
300
|
component: () => import('jsview-vue-samples/LatexFormula/App.vue'),
|
|
301
|
-
},
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
name: '触控示例',
|
|
304
|
+
path: '/feature/TouchWidget',
|
|
305
|
+
component: () => import('jsview-vue-samples/TouchWidget/App.vue'),
|
|
306
|
+
},
|
|
307
|
+
{
|
|
302
308
|
name: 'Swiper3dTest',
|
|
303
309
|
path: '/Operations/Swiper3D',
|
|
304
310
|
component: () => import('jsview-vue-samples/SwiperTest/App.vue'),
|
|
@@ -102,6 +102,14 @@ let tabItemFocus = (data) => {
|
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
+
let tabItemClick = (id, data) => {
|
|
106
|
+
console.log("testtest", "tabItemClick");
|
|
107
|
+
if (data.id != tabId.value) {
|
|
108
|
+
tabId.value = data.id;
|
|
109
|
+
contentData.value = dataList[data.id];
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
105
113
|
let onDialogAction = (msg) => {
|
|
106
114
|
showExitDialog.value = false;
|
|
107
115
|
changeFocus(preFocusName);
|
|
@@ -156,6 +164,7 @@ onDeactivated(() => {
|
|
|
156
164
|
:onEdge="onTabEdge"
|
|
157
165
|
:itemFocus="tabItemFocus"
|
|
158
166
|
:initId="tabId"
|
|
167
|
+
:itemClick="tabItemClick"
|
|
159
168
|
/>
|
|
160
169
|
</div>
|
|
161
170
|
|
package/TouchWidget/App.vue
CHANGED
|
@@ -12,7 +12,7 @@ const focusHub = useFocusHub();
|
|
|
12
12
|
|
|
13
13
|
const provideData = () => {
|
|
14
14
|
const data = [];
|
|
15
|
-
for (let i = 0; i <
|
|
15
|
+
for (let i = 0; i < 30; i++) {
|
|
16
16
|
data.push({
|
|
17
17
|
width: 500,
|
|
18
18
|
height: 190,
|
|
@@ -57,7 +57,7 @@ onMounted(() => {
|
|
|
57
57
|
<!-- 为了保证边缘的item缩放后依旧完整显示, 需要设置padding, 注意width/height是包含padding的 -->
|
|
58
58
|
<metro-widget
|
|
59
59
|
name="mwWidget"
|
|
60
|
-
:top="
|
|
60
|
+
:top="50"
|
|
61
61
|
:left="50"
|
|
62
62
|
:width="660"
|
|
63
63
|
:height="600"
|
package/TouchWidget/Item.vue
CHANGED
|
@@ -21,7 +21,7 @@ const onBlur = () => {
|
|
|
21
21
|
focused.value = false;
|
|
22
22
|
};
|
|
23
23
|
const onClick = () => {
|
|
24
|
-
console.log("testtest item onclick ", props.data);
|
|
24
|
+
console.log("testtest item onclick ", props.data.content);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
// 一般在create的时候进行回调的注册, 使用 option api的可以在created时进行注册
|
|
@@ -12,7 +12,10 @@ const focusHub = useFocusHub();
|
|
|
12
12
|
const mwRef = shallowRef(null);
|
|
13
13
|
|
|
14
14
|
const measures = (item) => {
|
|
15
|
-
return
|
|
15
|
+
return {
|
|
16
|
+
...item,
|
|
17
|
+
enableTap: true,
|
|
18
|
+
};
|
|
16
19
|
};
|
|
17
20
|
const randomColor = () => {
|
|
18
21
|
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|