@proteus-vue/create-proteus 0.2.1-beta.1 → 0.3.0-beta.10
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/package.json
CHANGED
package/templates/package.json
CHANGED
|
@@ -13,21 +13,21 @@
|
|
|
13
13
|
"proteus": "proteus"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@proteus-vue/router": "
|
|
17
|
-
"@proteus-vue/runtime": "
|
|
18
|
-
"@proteus-vue/shared": "
|
|
16
|
+
"@proteus-vue/router": "0.3.0-beta.10",
|
|
17
|
+
"@proteus-vue/runtime": "0.3.0-beta.10",
|
|
18
|
+
"@proteus-vue/shared": "0.3.0-beta.10",
|
|
19
19
|
"vue": "^3.4.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@proteus-vue/cli": "
|
|
23
|
-
"@proteus-vue/compiler": "
|
|
24
|
-
"@proteus-vue/
|
|
22
|
+
"@proteus-vue/cli": "0.3.0-beta.10",
|
|
23
|
+
"@proteus-vue/compiler": "0.3.0-beta.10",
|
|
24
|
+
"@proteus-vue/devtools-runtime": "0.3.0-beta.10",
|
|
25
|
+
"@proteus-vue/plugin-vite": "0.3.0-beta.10",
|
|
25
26
|
"@types/node": "^20.0.0",
|
|
26
27
|
"@vitejs/plugin-vue": "^5.0.0",
|
|
27
28
|
"tsx": "^4.0.0",
|
|
28
29
|
"typescript": "^5.4.0",
|
|
29
30
|
"vite": "^5.0.0",
|
|
30
|
-
"vue-tsc": "^2.0.0"
|
|
31
|
-
"@proteus-vue/devtools-runtime": "^0.1.0"
|
|
31
|
+
"vue-tsc": "^2.0.0"
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
}
|
|
@@ -54,10 +54,15 @@ adapter.onPageLoad?.((route, query, routeType, nav) => {
|
|
|
54
54
|
|
|
55
55
|
const currentRoute = computed(() => current.value || 'pages/index')
|
|
56
56
|
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
// ★★2026-09-20:**所有转场统一走层叠路径**(新旧同屏重叠 → 绝对定位 + default 模式),
|
|
58
|
+
// 不再使用 `<Transition mode="out-in">`。原因见外部实战报告第十一节第五条(阻断级):
|
|
59
|
+
// out-in 依赖 Vue 的 `afterLeave` 回调复位 BaseTransition 的 `state.isLeaving`;实测在特定页面
|
|
60
|
+
// (离开「工作台」后)该回调**永久不触发** → `state.isLeaving` 恒为 true → 此后**每一次**页面切换
|
|
61
|
+
// 都被短路成空注释(URL 变了 / 页面空白 / 控制台零报错 / 永久卡死,必须刷新)。
|
|
62
|
+
// 触发条件未定位到根因(外部项目已二分排除抽屉、内容区块、柔性布局、导航方式),
|
|
63
|
+
// 但**层叠路径不依赖任何完成回调**——统一走它可整类消除该失败模式(外部项目已实测通过)。
|
|
64
|
+
// 层叠语义同时更贴近小程序:旧页保留、新页覆盖,而不是先销毁后渲染。
|
|
65
|
+
const isLayered = true
|
|
61
66
|
|
|
62
67
|
// 遮罩对齐 MP barrierColor:halfScreen 0.4 / scaleDown 0.8(forward + back 都显示);slideUp opaque 无遮罩
|
|
63
68
|
// 遮罩常驻但被停留页(z:2)盖住:forward 时旧页(z:0)暴露在遮罩下淡入,back 时前页(z:0)暴露在遮罩下淡出
|
|
@@ -82,10 +87,12 @@ const view = computed<Component | null>(() => {
|
|
|
82
87
|
</script>
|
|
83
88
|
|
|
84
89
|
<template>
|
|
85
|
-
<!--
|
|
86
|
-
halfScreen/slideUp/scaleDown
|
|
90
|
+
<!-- 转场全部层叠(default 模式 + 绝对定位重叠 → 新旧同屏):
|
|
91
|
+
各 routeType 自带层叠语义(halfScreen/slideUp/scaleDown 的 enter/leave 规则),
|
|
92
|
+
fade 亦为交叉淡入;**不用 out-in**(其 afterLeave 不触发会让该 RouterView 永久卡死,
|
|
93
|
+
见 script 中 isLayered 处注释与外部实战报告第十一节第五条)
|
|
87
94
|
:key 按路由强制重挂载触发过渡 -->
|
|
88
|
-
<div class="router-view
|
|
95
|
+
<div class="router-view layered">
|
|
89
96
|
<!-- 遮罩层(对齐 MP barrierColor):旧页/前页(z:0)之上、停留页(z:2)之下;forward 淡入压暗,back 淡出抬起 -->
|
|
90
97
|
<div
|
|
91
98
|
v-if="showBarrier"
|
|
@@ -93,7 +100,7 @@ const view = computed<Component | null>(() => {
|
|
|
93
100
|
:class="{ 'barrier-out': isBack }"
|
|
94
101
|
:style="{ '--barrier-opacity': barrierOpacity }"
|
|
95
102
|
/>
|
|
96
|
-
<Transition :name="transitionName"
|
|
103
|
+
<Transition :name="transitionName">
|
|
97
104
|
<!-- ★v-bind="currentQuery":路由参数透传给页面(页面用 defineProps 声明即收到;
|
|
98
105
|
未声明的页面不受影响)。修 Web 端「参数两条路都拿不到」见 currentQuery 处注释 -->
|
|
99
106
|
<component :is="view" v-if="view" :key="currentRoute" v-bind="currentQuery" class="page" />
|
|
@@ -103,7 +110,7 @@ const view = computed<Component | null>(() => {
|
|
|
103
110
|
</template>
|
|
104
111
|
|
|
105
112
|
<style scoped>
|
|
106
|
-
/*
|
|
113
|
+
/* 层叠容器:所有转场均为新旧同屏绝对定位重叠(不再有 out-in 分支,见 script 注释) */
|
|
107
114
|
.router-view {
|
|
108
115
|
position: relative;
|
|
109
116
|
min-height: 100vh;
|
|
@@ -295,7 +302,7 @@ const view = computed<Component | null>(() => {
|
|
|
295
302
|
transform: translateY(100%);
|
|
296
303
|
}
|
|
297
304
|
|
|
298
|
-
/* replace(redirectTo
|
|
305
|
+
/* replace(redirectTo):替换当前页——旧页轻微缩小淡出、新页淡入(层叠交叉) */
|
|
299
306
|
.replace-enter-active,
|
|
300
307
|
.replace-leave-active {
|
|
301
308
|
transition:
|