@vuepress/client 2.0.0-beta.64 → 2.0.0-beta.65
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/app.js +13 -3
- package/dist/{chunk-X6BS2PXP.js → chunk-IKARB3UY.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
usePageLang,
|
|
18
18
|
usePageLayout,
|
|
19
19
|
withBase
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-IKARB3UY.js";
|
|
21
21
|
|
|
22
22
|
// src/app.ts
|
|
23
23
|
import { clientConfigs } from "@internal/clientConfigs";
|
|
@@ -101,13 +101,21 @@ var createVueRouter = () => {
|
|
|
101
101
|
return { top: 0 };
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
+
let pendingPageData;
|
|
105
|
+
let pendingToPath;
|
|
104
106
|
router.beforeResolve(async (to, from) => {
|
|
105
107
|
if (to.path !== from.path || from === START_LOCATION) {
|
|
106
108
|
;
|
|
107
|
-
[
|
|
109
|
+
[pendingPageData] = await Promise.all([
|
|
108
110
|
resolvers.resolvePageData(to.name),
|
|
109
111
|
pagesComponents[to.name]?.__asyncLoader()
|
|
110
112
|
]);
|
|
113
|
+
pendingToPath = to.path;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
router.afterEach((to, from) => {
|
|
117
|
+
if (to.path !== from.path && to.path === pendingToPath) {
|
|
118
|
+
pageData.value = pendingPageData;
|
|
111
119
|
}
|
|
112
120
|
});
|
|
113
121
|
return router;
|
|
@@ -144,7 +152,9 @@ var setupGlobalComputed = (app, router, clientConfigs2) => {
|
|
|
144
152
|
siteLocaleData.value
|
|
145
153
|
)
|
|
146
154
|
);
|
|
147
|
-
const pageLang = computed(
|
|
155
|
+
const pageLang = computed(
|
|
156
|
+
() => resolvers.resolvePageLang(pageData.value, siteLocaleData.value)
|
|
157
|
+
);
|
|
148
158
|
const pageLayout = computed(
|
|
149
159
|
() => resolvers.resolvePageLayout(pageData.value, layouts.value)
|
|
150
160
|
);
|
|
@@ -218,7 +218,7 @@ var resolvers = reactive({
|
|
|
218
218
|
*
|
|
219
219
|
* It would be used as the `lang` attribute of `<html>` tag
|
|
220
220
|
*/
|
|
221
|
-
resolvePageLang: (page) => page.lang || "en",
|
|
221
|
+
resolvePageLang: (page, siteLocale) => page.lang || siteLocale.lang || "en-US",
|
|
222
222
|
/**
|
|
223
223
|
* Resolve layout component of current page
|
|
224
224
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -278,7 +278,7 @@ declare const resolvers: {
|
|
|
278
278
|
resolvePageFrontmatter: (pageData: PageData) => PageFrontmatter;
|
|
279
279
|
resolvePageHead: (headTitle: PageHeadTitle, frontmatter: PageFrontmatter, siteLocale: SiteLocaleData) => PageHead;
|
|
280
280
|
resolvePageHeadTitle: (page: PageData, siteLocale: SiteLocaleData) => PageHeadTitle;
|
|
281
|
-
resolvePageLang: (page: PageData) => PageLang;
|
|
281
|
+
resolvePageLang: (page: PageData, siteLocale: SiteLocaleData) => PageLang;
|
|
282
282
|
resolvePageLayout: (page: PageData, layouts: Layouts) => Component;
|
|
283
283
|
resolveRouteLocale: (locales: SiteData['locales'], routePath: string) => RouteLocale;
|
|
284
284
|
resolveSiteLocaleData: (site: SiteData, routeLocale: RouteLocale) => SiteLocaleData;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/client",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.65",
|
|
4
4
|
"description": "Client package of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@vue/devtools-api": "^6.5.0",
|
|
37
37
|
"@vueuse/core": "^10.2.1",
|
|
38
38
|
"vue": "^3.3.4",
|
|
39
|
-
"vue-router": "^4.2.
|
|
40
|
-
"@vuepress/shared": "2.0.0-beta.
|
|
39
|
+
"vue-router": "^4.2.4",
|
|
40
|
+
"@vuepress/shared": "2.0.0-beta.65"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|