@tarojs/router 3.6.28 → 3.6.29
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/dist/api.js +11 -14
- package/dist/index.cjs.js +43 -30
- package/dist/index.esm.js +43 -30
- package/dist/router/index.d.ts +1 -0
- package/dist/router/index.js +3 -2
- package/dist/router/navigation-bar.js +1 -1
- package/dist/router/page.d.ts +2 -1
- package/dist/router/page.js +23 -11
- package/dist/router/spa.js +2 -1
- package/dist/style.js +4 -2
- package/package.json +7 -7
package/dist/api.js
CHANGED
|
@@ -50,22 +50,19 @@ function navigate(option, method) {
|
|
|
50
50
|
});
|
|
51
51
|
try {
|
|
52
52
|
if ('url' in option) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return resolve(res);
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
return reject(res);
|
|
66
|
-
}
|
|
53
|
+
if (!RouterConfig.isPage(addLeadingSlash(option.url))) {
|
|
54
|
+
const res = { errMsg: `${method}:fail page ${option.url} is not found` };
|
|
55
|
+
fail === null || fail === void 0 ? void 0 : fail(res);
|
|
56
|
+
complete === null || complete === void 0 ? void 0 : complete(res);
|
|
57
|
+
if (fail || complete) {
|
|
58
|
+
return resolve(res);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
return reject(res);
|
|
67
62
|
}
|
|
68
63
|
}
|
|
64
|
+
const pathPieces = processNavigateUrl(option);
|
|
65
|
+
const state = { timestamp: Date.now() };
|
|
69
66
|
if (method === 'navigateTo') {
|
|
70
67
|
history.push(pathPieces, state);
|
|
71
68
|
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -32,6 +32,7 @@ body {
|
|
|
32
32
|
.taro_router > .taro_page.taro_tabbar_page,
|
|
33
33
|
.taro_router > .taro_page.taro_page_show.taro_page_stationed {
|
|
34
34
|
transform: none;
|
|
35
|
+
transition: none;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
.taro_router > .taro_page.taro_page_show {
|
|
@@ -71,8 +72,9 @@ ${enableTabBar ? `
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
` : ''}
|
|
74
|
-
.taro_page_shade,
|
|
75
|
-
.
|
|
75
|
+
.taro_page_shade:has(+.taro_page_stationed),
|
|
76
|
+
.taro_page_shade.taro_tabbar_page,
|
|
77
|
+
.taro_router > .taro_page.taro_page_show.taro_page_stationed:not(.taro_page_shade):not(.taro_tabbar_page):not(:last-child):has(+.taro_page_stationed) {
|
|
76
78
|
display: none;
|
|
77
79
|
}
|
|
78
80
|
`;
|
|
@@ -262,8 +264,9 @@ class RouterConfig {
|
|
|
262
264
|
return this.router.mode || 'hash';
|
|
263
265
|
}
|
|
264
266
|
static get customRoutes() { return this.router.customRoutes || {}; }
|
|
267
|
+
// 这个方法不考虑 basename 和 customRoutes,只判断原始的 url 是否在 pages 中
|
|
265
268
|
static isPage(url = '') {
|
|
266
|
-
return this.pages.findIndex(e =>
|
|
269
|
+
return this.pages.findIndex(e => runtime.addLeadingSlash(e) === url) !== -1;
|
|
267
270
|
}
|
|
268
271
|
}
|
|
269
272
|
|
|
@@ -566,22 +569,19 @@ function navigate(option, method) {
|
|
|
566
569
|
});
|
|
567
570
|
try {
|
|
568
571
|
if ('url' in option) {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
if (
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
return resolve(res);
|
|
579
|
-
}
|
|
580
|
-
else {
|
|
581
|
-
return reject(res);
|
|
582
|
-
}
|
|
572
|
+
if (!RouterConfig.isPage(runtime.addLeadingSlash(option.url))) {
|
|
573
|
+
const res = { errMsg: `${method}:fail page ${option.url} is not found` };
|
|
574
|
+
fail === null || fail === void 0 ? void 0 : fail(res);
|
|
575
|
+
complete === null || complete === void 0 ? void 0 : complete(res);
|
|
576
|
+
if (fail || complete) {
|
|
577
|
+
return resolve(res);
|
|
578
|
+
}
|
|
579
|
+
else {
|
|
580
|
+
return reject(res);
|
|
583
581
|
}
|
|
584
582
|
}
|
|
583
|
+
const pathPieces = processNavigateUrl(option);
|
|
584
|
+
const state = { timestamp: Date.now() };
|
|
585
585
|
if (method === 'navigateTo') {
|
|
586
586
|
exports.history.push(pathPieces, state);
|
|
587
587
|
}
|
|
@@ -926,7 +926,7 @@ class NavigationBarHandler {
|
|
|
926
926
|
});
|
|
927
927
|
}
|
|
928
928
|
toHomeFn() {
|
|
929
|
-
reLaunch({ url: this.pageContext.
|
|
929
|
+
reLaunch({ url: this.pageContext.originHomePage });
|
|
930
930
|
}
|
|
931
931
|
backFn() {
|
|
932
932
|
navigateBack();
|
|
@@ -1158,6 +1158,7 @@ class PageHandler {
|
|
|
1158
1158
|
this.defaultAnimation = { duration: 300, delay: 50 };
|
|
1159
1159
|
this.config = config;
|
|
1160
1160
|
this.homePage = runtime.getHomePage(this.routes[0].path, this.basename, this.customRoutes, this.config.entryPagePath);
|
|
1161
|
+
this.originHomePage = this.config.entryPagePath || this.routes[0].path || this.basename;
|
|
1161
1162
|
this.mount();
|
|
1162
1163
|
this.navigationBarHandler = new NavigationBarHandler(this);
|
|
1163
1164
|
}
|
|
@@ -1388,24 +1389,35 @@ class PageHandler {
|
|
|
1388
1389
|
});
|
|
1389
1390
|
}
|
|
1390
1391
|
}
|
|
1391
|
-
hide(page) {
|
|
1392
|
-
var _a;
|
|
1392
|
+
hide(page, animation = false) {
|
|
1393
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1393
1394
|
if (!page)
|
|
1394
1395
|
return;
|
|
1395
1396
|
// NOTE: 修复多页并发问题,此处可能因为路由跳转过快,执行时页面可能还没有创建成功
|
|
1396
1397
|
const pageEl = this.getPageContainer(page);
|
|
1397
1398
|
if (pageEl) {
|
|
1398
|
-
if (
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1399
|
+
if (animation) {
|
|
1400
|
+
if (this.hideTimer) {
|
|
1401
|
+
clearTimeout(this.hideTimer);
|
|
1402
|
+
this.hideTimer = null;
|
|
1403
|
+
(_c = (_b = (_a = this.lastHidePage) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.add) === null || _c === void 0 ? void 0 : _c.call(_b, 'taro_page_shade');
|
|
1404
|
+
}
|
|
1405
|
+
this.lastHidePage = pageEl;
|
|
1406
|
+
this.hideTimer = setTimeout(() => {
|
|
1407
|
+
this.hideTimer = null;
|
|
1408
|
+
pageEl.classList.add('taro_page_shade');
|
|
1409
|
+
}, this.animationDuration + this.animationDelay);
|
|
1410
|
+
(_d = page.onHide) === null || _d === void 0 ? void 0 : _d.call(page);
|
|
1402
1411
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1412
|
+
else {
|
|
1413
|
+
if (this.hideTimer) {
|
|
1414
|
+
clearTimeout(this.hideTimer);
|
|
1415
|
+
this.hideTimer = null;
|
|
1416
|
+
(_g = (_f = (_e = this.lastHidePage) === null || _e === void 0 ? void 0 : _e.classList) === null || _f === void 0 ? void 0 : _f.add) === null || _g === void 0 ? void 0 : _g.call(_f, 'taro_page_shade');
|
|
1417
|
+
}
|
|
1406
1418
|
pageEl.classList.add('taro_page_shade');
|
|
1407
|
-
|
|
1408
|
-
|
|
1419
|
+
this.lastHidePage = pageEl;
|
|
1420
|
+
}
|
|
1409
1421
|
}
|
|
1410
1422
|
else {
|
|
1411
1423
|
setTimeout(() => this.hide(page), 0);
|
|
@@ -1573,6 +1585,7 @@ function createRouter(history$1, app, config, framework) {
|
|
|
1573
1585
|
if (handler.isSamePage(currentPage))
|
|
1574
1586
|
return;
|
|
1575
1587
|
if (handler.isTabBar(currentPage.path)) {
|
|
1588
|
+
// NOTE: 从 tabBar 页面切换到 tabBar 页面
|
|
1576
1589
|
handler.hide(currentPage);
|
|
1577
1590
|
stacks.pushTab(currentPage.path.split('?')[0]);
|
|
1578
1591
|
}
|
|
@@ -1616,7 +1629,7 @@ function createRouter(history$1, app, config, framework) {
|
|
|
1616
1629
|
shouldLoad = true;
|
|
1617
1630
|
}
|
|
1618
1631
|
else if (action === 'PUSH') {
|
|
1619
|
-
handler.hide(currentPage);
|
|
1632
|
+
handler.hide(currentPage, true);
|
|
1620
1633
|
shouldLoad = true;
|
|
1621
1634
|
}
|
|
1622
1635
|
if (shouldLoad || stacks.length < 1) {
|
package/dist/index.esm.js
CHANGED
|
@@ -31,6 +31,7 @@ body {
|
|
|
31
31
|
.taro_router > .taro_page.taro_tabbar_page,
|
|
32
32
|
.taro_router > .taro_page.taro_page_show.taro_page_stationed {
|
|
33
33
|
transform: none;
|
|
34
|
+
transition: none;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
.taro_router > .taro_page.taro_page_show {
|
|
@@ -70,8 +71,9 @@ ${enableTabBar ? `
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
` : ''}
|
|
73
|
-
.taro_page_shade,
|
|
74
|
-
.
|
|
74
|
+
.taro_page_shade:has(+.taro_page_stationed),
|
|
75
|
+
.taro_page_shade.taro_tabbar_page,
|
|
76
|
+
.taro_router > .taro_page.taro_page_show.taro_page_stationed:not(.taro_page_shade):not(.taro_tabbar_page):not(:last-child):has(+.taro_page_stationed) {
|
|
75
77
|
display: none;
|
|
76
78
|
}
|
|
77
79
|
`;
|
|
@@ -261,8 +263,9 @@ class RouterConfig {
|
|
|
261
263
|
return this.router.mode || 'hash';
|
|
262
264
|
}
|
|
263
265
|
static get customRoutes() { return this.router.customRoutes || {}; }
|
|
266
|
+
// 这个方法不考虑 basename 和 customRoutes,只判断原始的 url 是否在 pages 中
|
|
264
267
|
static isPage(url = '') {
|
|
265
|
-
return this.pages.findIndex(e =>
|
|
268
|
+
return this.pages.findIndex(e => addLeadingSlash(e) === url) !== -1;
|
|
266
269
|
}
|
|
267
270
|
}
|
|
268
271
|
|
|
@@ -565,22 +568,19 @@ function navigate(option, method) {
|
|
|
565
568
|
});
|
|
566
569
|
try {
|
|
567
570
|
if ('url' in option) {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
if (
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
return resolve(res);
|
|
578
|
-
}
|
|
579
|
-
else {
|
|
580
|
-
return reject(res);
|
|
581
|
-
}
|
|
571
|
+
if (!RouterConfig.isPage(addLeadingSlash(option.url))) {
|
|
572
|
+
const res = { errMsg: `${method}:fail page ${option.url} is not found` };
|
|
573
|
+
fail === null || fail === void 0 ? void 0 : fail(res);
|
|
574
|
+
complete === null || complete === void 0 ? void 0 : complete(res);
|
|
575
|
+
if (fail || complete) {
|
|
576
|
+
return resolve(res);
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
return reject(res);
|
|
582
580
|
}
|
|
583
581
|
}
|
|
582
|
+
const pathPieces = processNavigateUrl(option);
|
|
583
|
+
const state = { timestamp: Date.now() };
|
|
584
584
|
if (method === 'navigateTo') {
|
|
585
585
|
history.push(pathPieces, state);
|
|
586
586
|
}
|
|
@@ -925,7 +925,7 @@ class NavigationBarHandler {
|
|
|
925
925
|
});
|
|
926
926
|
}
|
|
927
927
|
toHomeFn() {
|
|
928
|
-
reLaunch({ url: this.pageContext.
|
|
928
|
+
reLaunch({ url: this.pageContext.originHomePage });
|
|
929
929
|
}
|
|
930
930
|
backFn() {
|
|
931
931
|
navigateBack();
|
|
@@ -1157,6 +1157,7 @@ class PageHandler {
|
|
|
1157
1157
|
this.defaultAnimation = { duration: 300, delay: 50 };
|
|
1158
1158
|
this.config = config;
|
|
1159
1159
|
this.homePage = getHomePage(this.routes[0].path, this.basename, this.customRoutes, this.config.entryPagePath);
|
|
1160
|
+
this.originHomePage = this.config.entryPagePath || this.routes[0].path || this.basename;
|
|
1160
1161
|
this.mount();
|
|
1161
1162
|
this.navigationBarHandler = new NavigationBarHandler(this);
|
|
1162
1163
|
}
|
|
@@ -1387,24 +1388,35 @@ class PageHandler {
|
|
|
1387
1388
|
});
|
|
1388
1389
|
}
|
|
1389
1390
|
}
|
|
1390
|
-
hide(page) {
|
|
1391
|
-
var _a;
|
|
1391
|
+
hide(page, animation = false) {
|
|
1392
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1392
1393
|
if (!page)
|
|
1393
1394
|
return;
|
|
1394
1395
|
// NOTE: 修复多页并发问题,此处可能因为路由跳转过快,执行时页面可能还没有创建成功
|
|
1395
1396
|
const pageEl = this.getPageContainer(page);
|
|
1396
1397
|
if (pageEl) {
|
|
1397
|
-
if (
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1398
|
+
if (animation) {
|
|
1399
|
+
if (this.hideTimer) {
|
|
1400
|
+
clearTimeout(this.hideTimer);
|
|
1401
|
+
this.hideTimer = null;
|
|
1402
|
+
(_c = (_b = (_a = this.lastHidePage) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.add) === null || _c === void 0 ? void 0 : _c.call(_b, 'taro_page_shade');
|
|
1403
|
+
}
|
|
1404
|
+
this.lastHidePage = pageEl;
|
|
1405
|
+
this.hideTimer = setTimeout(() => {
|
|
1406
|
+
this.hideTimer = null;
|
|
1407
|
+
pageEl.classList.add('taro_page_shade');
|
|
1408
|
+
}, this.animationDuration + this.animationDelay);
|
|
1409
|
+
(_d = page.onHide) === null || _d === void 0 ? void 0 : _d.call(page);
|
|
1401
1410
|
}
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1411
|
+
else {
|
|
1412
|
+
if (this.hideTimer) {
|
|
1413
|
+
clearTimeout(this.hideTimer);
|
|
1414
|
+
this.hideTimer = null;
|
|
1415
|
+
(_g = (_f = (_e = this.lastHidePage) === null || _e === void 0 ? void 0 : _e.classList) === null || _f === void 0 ? void 0 : _f.add) === null || _g === void 0 ? void 0 : _g.call(_f, 'taro_page_shade');
|
|
1416
|
+
}
|
|
1405
1417
|
pageEl.classList.add('taro_page_shade');
|
|
1406
|
-
|
|
1407
|
-
|
|
1418
|
+
this.lastHidePage = pageEl;
|
|
1419
|
+
}
|
|
1408
1420
|
}
|
|
1409
1421
|
else {
|
|
1410
1422
|
setTimeout(() => this.hide(page), 0);
|
|
@@ -1572,6 +1584,7 @@ function createRouter(history, app, config, framework) {
|
|
|
1572
1584
|
if (handler.isSamePage(currentPage))
|
|
1573
1585
|
return;
|
|
1574
1586
|
if (handler.isTabBar(currentPage.path)) {
|
|
1587
|
+
// NOTE: 从 tabBar 页面切换到 tabBar 页面
|
|
1575
1588
|
handler.hide(currentPage);
|
|
1576
1589
|
stacks.pushTab(currentPage.path.split('?')[0]);
|
|
1577
1590
|
}
|
|
@@ -1615,7 +1628,7 @@ function createRouter(history, app, config, framework) {
|
|
|
1615
1628
|
shouldLoad = true;
|
|
1616
1629
|
}
|
|
1617
1630
|
else if (action === 'PUSH') {
|
|
1618
|
-
handler.hide(currentPage);
|
|
1631
|
+
handler.hide(currentPage, true);
|
|
1619
1632
|
shouldLoad = true;
|
|
1620
1633
|
}
|
|
1621
1634
|
if (shouldLoad || stacks.length < 1) {
|
package/dist/router/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ declare class RouterConfig {
|
|
|
7
7
|
static get router(): import("../types/router").Router;
|
|
8
8
|
static get mode(): "hash" | "browser" | "multi";
|
|
9
9
|
static get customRoutes(): Record<string, string | string[]>;
|
|
10
|
+
// 这个方法不考虑 basename 和 customRoutes,只判断原始的 url 是否在 pages 中
|
|
10
11
|
static isPage(url?: string): boolean;
|
|
11
12
|
}
|
|
12
13
|
export { RouterConfig };
|
package/dist/router/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { addLeadingSlash } from '@tarojs/runtime';
|
|
2
2
|
|
|
3
3
|
class RouterConfig {
|
|
4
4
|
static set config(e) {
|
|
@@ -17,8 +17,9 @@ class RouterConfig {
|
|
|
17
17
|
return this.router.mode || 'hash';
|
|
18
18
|
}
|
|
19
19
|
static get customRoutes() { return this.router.customRoutes || {}; }
|
|
20
|
+
// 这个方法不考虑 basename 和 customRoutes,只判断原始的 url 是否在 pages 中
|
|
20
21
|
static isPage(url = '') {
|
|
21
|
-
return this.pages.findIndex(e =>
|
|
22
|
+
return this.pages.findIndex(e => addLeadingSlash(e) === url) !== -1;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
package/dist/router/page.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ declare class PageHandler {
|
|
|
13
13
|
protected lastUnloadPage: PageInstance | null;
|
|
14
14
|
protected navigationBarHandler: NavigationBarHandler;
|
|
15
15
|
homePage: string;
|
|
16
|
+
originHomePage: string;
|
|
16
17
|
constructor(config: SpaRouterConfig, history: History);
|
|
17
18
|
get currentPage(): string;
|
|
18
19
|
get appId(): string;
|
|
@@ -42,7 +43,7 @@ declare class PageHandler {
|
|
|
42
43
|
load(page: PageInstance, pageConfig: Route | undefined, stampId: string, pageNo?: number): void;
|
|
43
44
|
unload(page?: PageInstance | null, delta?: number, top?: boolean): void;
|
|
44
45
|
show(page?: PageInstance | null, pageConfig?: Route, pageNo?: number): void;
|
|
45
|
-
hide(page?: PageInstance | null): void;
|
|
46
|
+
hide(page?: PageInstance | null, animation?: boolean): void;
|
|
46
47
|
addAnimation(pageEl?: HTMLElement | null, first?: boolean): void;
|
|
47
48
|
getPageContainer(page?: PageInstance | null): HTMLElement | null;
|
|
48
49
|
getScrollingElement(page?: PageInstance | null): HTMLElement | (Window & typeof globalThis);
|
package/dist/router/page.js
CHANGED
|
@@ -15,6 +15,7 @@ class PageHandler {
|
|
|
15
15
|
this.defaultAnimation = { duration: 300, delay: 50 };
|
|
16
16
|
this.config = config;
|
|
17
17
|
this.homePage = getHomePage(this.routes[0].path, this.basename, this.customRoutes, this.config.entryPagePath);
|
|
18
|
+
this.originHomePage = this.config.entryPagePath || this.routes[0].path || this.basename;
|
|
18
19
|
this.mount();
|
|
19
20
|
this.navigationBarHandler = new NavigationBarHandler(this);
|
|
20
21
|
}
|
|
@@ -245,24 +246,35 @@ class PageHandler {
|
|
|
245
246
|
});
|
|
246
247
|
}
|
|
247
248
|
}
|
|
248
|
-
hide(page) {
|
|
249
|
-
var _a;
|
|
249
|
+
hide(page, animation = false) {
|
|
250
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
250
251
|
if (!page)
|
|
251
252
|
return;
|
|
252
253
|
// NOTE: 修复多页并发问题,此处可能因为路由跳转过快,执行时页面可能还没有创建成功
|
|
253
254
|
const pageEl = this.getPageContainer(page);
|
|
254
255
|
if (pageEl) {
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
256
|
+
if (animation) {
|
|
257
|
+
if (this.hideTimer) {
|
|
258
|
+
clearTimeout(this.hideTimer);
|
|
259
|
+
this.hideTimer = null;
|
|
260
|
+
(_c = (_b = (_a = this.lastHidePage) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.add) === null || _c === void 0 ? void 0 : _c.call(_b, 'taro_page_shade');
|
|
261
|
+
}
|
|
262
|
+
this.lastHidePage = pageEl;
|
|
263
|
+
this.hideTimer = setTimeout(() => {
|
|
264
|
+
this.hideTimer = null;
|
|
265
|
+
pageEl.classList.add('taro_page_shade');
|
|
266
|
+
}, this.animationDuration + this.animationDelay);
|
|
267
|
+
(_d = page.onHide) === null || _d === void 0 ? void 0 : _d.call(page);
|
|
259
268
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
269
|
+
else {
|
|
270
|
+
if (this.hideTimer) {
|
|
271
|
+
clearTimeout(this.hideTimer);
|
|
272
|
+
this.hideTimer = null;
|
|
273
|
+
(_g = (_f = (_e = this.lastHidePage) === null || _e === void 0 ? void 0 : _e.classList) === null || _f === void 0 ? void 0 : _f.add) === null || _g === void 0 ? void 0 : _g.call(_f, 'taro_page_shade');
|
|
274
|
+
}
|
|
263
275
|
pageEl.classList.add('taro_page_shade');
|
|
264
|
-
|
|
265
|
-
|
|
276
|
+
this.lastHidePage = pageEl;
|
|
277
|
+
}
|
|
266
278
|
}
|
|
267
279
|
else {
|
|
268
280
|
setTimeout(() => this.hide(page), 0);
|
package/dist/router/spa.js
CHANGED
|
@@ -114,6 +114,7 @@ function createRouter(history, app, config, framework) {
|
|
|
114
114
|
if (handler.isSamePage(currentPage))
|
|
115
115
|
return;
|
|
116
116
|
if (handler.isTabBar(currentPage.path)) {
|
|
117
|
+
// NOTE: 从 tabBar 页面切换到 tabBar 页面
|
|
117
118
|
handler.hide(currentPage);
|
|
118
119
|
stacks.pushTab(currentPage.path.split('?')[0]);
|
|
119
120
|
}
|
|
@@ -157,7 +158,7 @@ function createRouter(history, app, config, framework) {
|
|
|
157
158
|
shouldLoad = true;
|
|
158
159
|
}
|
|
159
160
|
else if (action === 'PUSH') {
|
|
160
|
-
handler.hide(currentPage);
|
|
161
|
+
handler.hide(currentPage, true);
|
|
161
162
|
shouldLoad = true;
|
|
162
163
|
}
|
|
163
164
|
if (shouldLoad || stacks.length < 1) {
|
package/dist/style.js
CHANGED
|
@@ -21,6 +21,7 @@ body {
|
|
|
21
21
|
.taro_router > .taro_page.taro_tabbar_page,
|
|
22
22
|
.taro_router > .taro_page.taro_page_show.taro_page_stationed {
|
|
23
23
|
transform: none;
|
|
24
|
+
transition: none;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
.taro_router > .taro_page.taro_page_show {
|
|
@@ -60,8 +61,9 @@ ${enableTabBar ? `
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
` : ''}
|
|
63
|
-
.taro_page_shade,
|
|
64
|
-
.
|
|
64
|
+
.taro_page_shade:has(+.taro_page_stationed),
|
|
65
|
+
.taro_page_shade.taro_tabbar_page,
|
|
66
|
+
.taro_router > .taro_page.taro_page_show.taro_page_stationed:not(.taro_page_shade):not(.taro_tabbar_page):not(:last-child):has(+.taro_page_stationed) {
|
|
65
67
|
display: none;
|
|
66
68
|
}
|
|
67
69
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/router",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.29",
|
|
4
4
|
"description": "Taro-router",
|
|
5
5
|
"browser": "dist/index.js",
|
|
6
6
|
"main:h5": "dist/index.esm.js",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"rollup-plugin-ts": "^3.0.2",
|
|
45
45
|
"ts-jest": "^29.0.5",
|
|
46
46
|
"typescript": "^4.7.4",
|
|
47
|
-
"@tarojs/
|
|
48
|
-
"@tarojs/
|
|
49
|
-
"@tarojs/shared": "3.6.
|
|
47
|
+
"@tarojs/runtime": "3.6.29",
|
|
48
|
+
"@tarojs/taro": "3.6.29",
|
|
49
|
+
"@tarojs/shared": "3.6.29"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@tarojs/
|
|
53
|
-
"@tarojs/
|
|
54
|
-
"@tarojs/shared": "3.6.
|
|
52
|
+
"@tarojs/runtime": "3.6.29",
|
|
53
|
+
"@tarojs/taro": "3.6.29",
|
|
54
|
+
"@tarojs/shared": "3.6.29"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"prebuild": "pnpm run clean",
|