wevu 6.16.6 → 6.16.7
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/dev/index.mjs +1 -1
- package/dist/dev/router.mjs +34 -18
- package/dist/dev/router.mjs.map +1 -1
- package/dist/dev/{src-C2BzhMY6.mjs → src-C3ttY2ue.mjs} +2 -2
- package/dist/dev/{src-C2BzhMY6.mjs.map → src-C3ttY2ue.mjs.map} +1 -1
- package/dist/dev/vue-demi.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/router.d.mts +4 -1
- package/dist/router.mjs +1 -1
- package/dist/{src-BF-e4_0K.mjs → src-1LreGZrG.mjs} +1 -1
- package/dist/vue-demi.mjs +1 -1
- package/package.json +2 -2
package/dist/dev/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as isNoSetData, A as createApp, B as waitForLayoutHost, C as usePageStack, Ct as shallowRef, D as createWevuComponent, E as useDisposables, F as resolveLayoutHost, G as runSetupFunction, H as mountRuntimeInstance, I as unregisterPageLayoutBridge, J as syncRuntimePageLayoutState, K as resolveRuntimePageLayoutName, L as unregisterRuntimeLayoutHosts, M as registerPageLayoutBridge, N as registerRuntimeLayoutHosts, O as createWevuScopedSlotComponent, P as resolveLayoutBridge, Q as setWevuDefaults, R as useLayoutBridge, S as useNavigationBarMetrics, St as isShallowRef, T as useElementIntersectionObserver, U as setRuntimeSetDataVisibility, V as registerApp, W as teardownRuntimeInstance, X as usePageLayout, Y as syncRuntimePageLayoutStateFromRuntime, Z as resetWevuDefaults, _ as useSelectorQuery, _t as onUnmounted, a as useModel, at as watchSyncEffect, b as getCurrentPageStackSnapshot, bt as toRef, c as useSlots, ct as callUpdateHooks, d as useUpdatePerformanceListener, dt as onBeforeUnmount, et as markNoSetData, f as normalizeClass, ft as onBeforeUpdate, g as useSelectorFields, gt as onServerPrefetch, h as useScrollOffset, ht as onMounted, i as useChangeModel, it as watchPostEffect, j as registerComponent, k as defineComponent, l as defineAppSetup, lt as onActivated, m as useBoundingClientRect, mt as onErrorCaptured, n as mergeModels, nt as watch, o as useAttrs, ot as getDeepWatchStrategy, p as normalizeStyle, pt as onDeactivated, q as setPageLayout, r as useBindModel, rt as watchEffect, s as useNativeInstance, st as setDeepWatchStrategy, t as useTemplateRef, tt as version, u as use, ut as onBeforeMount, v as useAsyncPullDownRefresh, vt as onUpdated, w as useIntersectionObserver, wt as triggerRef, x as getNavigationBarMetrics, xt as toRefs, y as usePageScrollThrottle, yt as traverse, z as useLayoutHosts } from "./src-
|
|
1
|
+
import { $ as isNoSetData, A as createApp, B as waitForLayoutHost, C as usePageStack, Ct as shallowRef, D as createWevuComponent, E as useDisposables, F as resolveLayoutHost, G as runSetupFunction, H as mountRuntimeInstance, I as unregisterPageLayoutBridge, J as syncRuntimePageLayoutState, K as resolveRuntimePageLayoutName, L as unregisterRuntimeLayoutHosts, M as registerPageLayoutBridge, N as registerRuntimeLayoutHosts, O as createWevuScopedSlotComponent, P as resolveLayoutBridge, Q as setWevuDefaults, R as useLayoutBridge, S as useNavigationBarMetrics, St as isShallowRef, T as useElementIntersectionObserver, U as setRuntimeSetDataVisibility, V as registerApp, W as teardownRuntimeInstance, X as usePageLayout, Y as syncRuntimePageLayoutStateFromRuntime, Z as resetWevuDefaults, _ as useSelectorQuery, _t as onUnmounted, a as useModel, at as watchSyncEffect, b as getCurrentPageStackSnapshot, bt as toRef, c as useSlots, ct as callUpdateHooks, d as useUpdatePerformanceListener, dt as onBeforeUnmount, et as markNoSetData, f as normalizeClass, ft as onBeforeUpdate, g as useSelectorFields, gt as onServerPrefetch, h as useScrollOffset, ht as onMounted, i as useChangeModel, it as watchPostEffect, j as registerComponent, k as defineComponent, l as defineAppSetup, lt as onActivated, m as useBoundingClientRect, mt as onErrorCaptured, n as mergeModels, nt as watch, o as useAttrs, ot as getDeepWatchStrategy, p as normalizeStyle, pt as onDeactivated, q as setPageLayout, r as useBindModel, rt as watchEffect, s as useNativeInstance, st as setDeepWatchStrategy, t as useTemplateRef, tt as version, u as use, ut as onBeforeMount, v as useAsyncPullDownRefresh, vt as onUpdated, w as useIntersectionObserver, wt as triggerRef, x as getNavigationBarMetrics, xt as toRefs, y as usePageScrollThrottle, yt as traverse, z as useLayoutHosts } from "./src-C3ttY2ue.mjs";
|
|
2
2
|
import { C as effect, D as onScopeDispose, E as getCurrentScope, N as nextTick, O as startBatch, S as batch, T as endBatch, a as toValue, b as addMutationRecorder, c as isRaw, d as reactive, f as isShallowReactive, g as touchReactive, h as prelinkReactiveTree, i as ref, k as stop, l as isReactive, n as isRef, o as unref, p as shallowReactive, s as getReactiveVersion, t as customRef, u as markRaw, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-oJCdOWf7.mjs";
|
|
3
3
|
import { i as computed, n as defineStore, r as createStore, t as storeToRefs } from "./store-BhOds5RF.mjs";
|
|
4
4
|
import { $ as onUnhandledRejection, A as setGlobalProvidedValue, B as onPageNotFound, F as onHide, G as onResize, H as onPullDownRefresh, I as onLaunch, J as onShareAppMessage, K as onRouteDone, L as onLoad, M as onAttached, N as onDetached, P as onError, Q as onThemeChange, R as onMemoryWarning, U as onReachBottom, V as onPageScroll, W as onReady, X as onShow, Y as onShareTimeline, Z as onTabItemTap, _ as provide, _t as readonly, at as getCurrentSetupContext, ct as setCurrentSetupContext, et as onUnload, g as injectGlobal, gt as isReadonly, h as inject, ht as isProxy, it as getCurrentInstance, j as onAddToFavorites, m as hasInjectionContext, n as useNativeRouter, nt as callHookList, q as onSaveExitState, rt as callHookReturn, st as setCurrentInstance, t as useNativePageRouter, v as provideGlobal, vt as shallowReadonly, z as onMoved } from "./router-CXNNN43P.mjs";
|
package/dist/dev/router.mjs
CHANGED
|
@@ -1083,30 +1083,43 @@ function createRouteRegistry(namedRouteLookup) {
|
|
|
1083
1083
|
|
|
1084
1084
|
//#endregion
|
|
1085
1085
|
//#region src/router/useRoute.ts
|
|
1086
|
-
function
|
|
1086
|
+
function applyRouteState(routeState, nextRoute) {
|
|
1087
|
+
routeState.path = nextRoute.path;
|
|
1088
|
+
routeState.fullPath = nextRoute.fullPath;
|
|
1089
|
+
routeState.query = cloneLocationQuery(nextRoute.query);
|
|
1090
|
+
routeState.hash = nextRoute.hash;
|
|
1091
|
+
routeState.params = cloneRouteParams(nextRoute.params);
|
|
1092
|
+
if (nextRoute.name === void 0) delete routeState.name;
|
|
1093
|
+
else routeState.name = nextRoute.name;
|
|
1094
|
+
if (nextRoute.meta === void 0) delete routeState.meta;
|
|
1095
|
+
else routeState.meta = cloneRouteMeta(nextRoute.meta);
|
|
1096
|
+
if (nextRoute.href === void 0) delete routeState.href;
|
|
1097
|
+
else routeState.href = nextRoute.href;
|
|
1098
|
+
if (nextRoute.matched === void 0) delete routeState.matched;
|
|
1099
|
+
else routeState.matched = cloneRouteRecordMatchedList(nextRoute.matched);
|
|
1100
|
+
if (nextRoute.redirectedFrom === void 0) delete routeState.redirectedFrom;
|
|
1101
|
+
else routeState.redirectedFrom = cloneRouteLocationRedirectedFrom(nextRoute.redirectedFrom);
|
|
1102
|
+
}
|
|
1103
|
+
function useRoute(options = {}) {
|
|
1104
|
+
var _options$resolveRoute;
|
|
1087
1105
|
const setupContext = getCurrentSetupContext();
|
|
1088
1106
|
if (!setupContext) throw new Error("useRoute() 必须在 setup() 的同步阶段调用");
|
|
1089
1107
|
const fallbackPage = setupContext.instance;
|
|
1090
|
-
const
|
|
1108
|
+
const resolveRoute = (_options$resolveRoute = options.resolveRoute) !== null && _options$resolveRoute !== void 0 ? _options$resolveRoute : ((route) => {
|
|
1109
|
+
var _getActiveRouter$reso, _getActiveRouter;
|
|
1110
|
+
return (_getActiveRouter$reso = (_getActiveRouter = getActiveRouter()) === null || _getActiveRouter === void 0 ? void 0 : _getActiveRouter.resolve(route)) !== null && _getActiveRouter$reso !== void 0 ? _getActiveRouter$reso : route;
|
|
1111
|
+
});
|
|
1112
|
+
const currentRoute = resolveRoute(resolveCurrentRoute(void 0, fallbackPage));
|
|
1091
1113
|
const routeState = reactive({
|
|
1092
1114
|
path: currentRoute.path,
|
|
1093
1115
|
fullPath: currentRoute.fullPath,
|
|
1094
|
-
query: currentRoute.query,
|
|
1116
|
+
query: cloneLocationQuery(currentRoute.query),
|
|
1095
1117
|
hash: currentRoute.hash,
|
|
1096
|
-
params: currentRoute.params
|
|
1097
|
-
name: currentRoute.name
|
|
1118
|
+
params: cloneRouteParams(currentRoute.params)
|
|
1098
1119
|
});
|
|
1099
|
-
|
|
1120
|
+
applyRouteState(routeState, currentRoute);
|
|
1100
1121
|
function syncRoute(queryOverride) {
|
|
1101
|
-
|
|
1102
|
-
routeState.path = nextRoute.path;
|
|
1103
|
-
routeState.fullPath = nextRoute.fullPath;
|
|
1104
|
-
routeState.query = nextRoute.query;
|
|
1105
|
-
routeState.hash = nextRoute.hash;
|
|
1106
|
-
if (nextRoute.meta === void 0) delete routeState.meta;
|
|
1107
|
-
else routeState.meta = nextRoute.meta;
|
|
1108
|
-
routeState.params = nextRoute.params;
|
|
1109
|
-
routeState.name = nextRoute.name;
|
|
1122
|
+
applyRouteState(routeState, resolveRoute(resolveCurrentRoute(queryOverride, fallbackPage)));
|
|
1110
1123
|
}
|
|
1111
1124
|
onLoad((query) => {
|
|
1112
1125
|
syncRoute(query);
|
|
@@ -1143,7 +1156,6 @@ function useNativePageRouter() {
|
|
|
1143
1156
|
function createRouter(options = {}) {
|
|
1144
1157
|
var _options$maxRedirects, _options$paramsMode, _options$rejectOnErro, _options$parseQuery, _options$stringifyQue, _options$tabBarEntrie;
|
|
1145
1158
|
const nativeRouter = useNativeRouter();
|
|
1146
|
-
const route = useRoute();
|
|
1147
1159
|
const beforeEachGuards = /* @__PURE__ */ new Set();
|
|
1148
1160
|
const beforeResolveGuards = /* @__PURE__ */ new Set();
|
|
1149
1161
|
const afterEachHooks = /* @__PURE__ */ new Set();
|
|
@@ -1163,8 +1175,8 @@ function createRouter(options = {}) {
|
|
|
1163
1175
|
const tabBarPathSet = new Set(normalizedTabBarEntries);
|
|
1164
1176
|
const routeRegistry = createRouteRegistry(namedRouteLookup);
|
|
1165
1177
|
const routerOptions = createRouterOptionsSnapshot(normalizedTabBarEntries, routeRegistry.getRoutes(), paramsMode, maxRedirects, routeResolveCodec, rejectOnError);
|
|
1166
|
-
function
|
|
1167
|
-
const resolved =
|
|
1178
|
+
function enrichRouteRecordState(routeLocation) {
|
|
1179
|
+
const resolved = { ...routeLocation };
|
|
1168
1180
|
resolved.href = resolved.fullPath;
|
|
1169
1181
|
const matchedResult = resolveMatchedRouteRecord(resolved, namedRouteLookup);
|
|
1170
1182
|
if (matchedResult) {
|
|
@@ -1179,6 +1191,10 @@ function createRouter(options = {}) {
|
|
|
1179
1191
|
} else resolved.matched = [];
|
|
1180
1192
|
return resolved;
|
|
1181
1193
|
}
|
|
1194
|
+
function resolveWithCodec(to, currentPath) {
|
|
1195
|
+
return enrichRouteRecordState(resolveRouteLocation(typeof to === "string" ? to : resolveNamedRouteLocation(to, namedRouteLookup, paramsMode), currentPath, routeResolveCodec));
|
|
1196
|
+
}
|
|
1197
|
+
const route = useRoute({ resolveRoute: enrichRouteRecordState });
|
|
1182
1198
|
function resolve(to) {
|
|
1183
1199
|
return resolveWithCodec(to, route.path);
|
|
1184
1200
|
}
|