diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 574ad5b622..077c0a146a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,8 +12,8 @@ jobs: - uses: technote-space/get-diff-action@v4 with: PATTERNS: | - +(docs|docs-vuepress)/**/* - +(docs|docs-vuepress)/.*/**/* + +(docs|docs-vitepress)/**/* + +(docs|docs-vitepress)/.*/**/* # vuepress生成最终文档 - name: generate docs file if: env.GIT_DIFF @@ -30,6 +30,6 @@ jobs: username: ${{ secrets.DOCS_SERVER_USER }} key: ${{ secrets.DOCS_SERVER_KEY }} command_timeout: "20m" - source: "./docs-vuepress/.vuepress/dist/" + source: "./docs-vitepress/.vitepress/dist/" strip_components: 4 target: "${{ secrets.DOCS_SERVER_DIR }}" diff --git a/.gitignore b/.gitignore index 684ff00936..4680643a94 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ package-lock.json pnpm-lock.yaml yarn.lock .DS_Store -docs-vuepress/.vuepress/dist elevate/ -packages/webpack-plugin/lib/runtime/components/react/dist/ \ No newline at end of file +docs-vitepress/.vitepress/dist +docs-vitepress/.vitepress/cache +dev-dist +packages/webpack-plugin/lib/runtime/components/react/dist/ diff --git a/docs-vitepress/.vitepress/config.ts b/docs-vitepress/.vitepress/config.ts new file mode 100644 index 0000000000..a33b3513f7 --- /dev/null +++ b/docs-vitepress/.vitepress/config.ts @@ -0,0 +1,385 @@ +import { defineConfig } from "vitepress" +import { withPwa } from "@vite-pwa/vitepress" + +const sidebar = { + "/guide/": [ + { + text: "基础", + collapsable: false, + items: [ + { text: "快速开始", link: "/guide/basic/start" }, + { text: "介绍", link: "/guide/basic/intro" }, + { text: "单文件开发", link: "/guide/basic/single-file" }, + { text: "IDE 高亮配置", link: "/guide/basic/ide" }, + { text: "模板语法", link: "/guide/basic/template" }, + { text: "CSS 处理", link: "/guide/basic/css" }, + { text: "数据响应", link: "/guide/basic/reactive" }, + { + text: "类名样式绑定", + link: "/guide/basic/class-style-binding", + }, + { text: "条件渲染", link: "/guide/basic/conditional-render" }, + { text: "列表渲染", link: "/guide/basic/list-render" }, + { text: "事件处理", link: "/guide/basic/event" }, + { text: "双向绑定", link: "/guide/basic/two-way-binding" }, + { text: "自定义组件", link: "/guide/basic/component" }, + { text: "获取组件实例/节点信息", link: "/guide/basic/refs" }, + { + text: "模版内可选链表达式", + link: "/guide/basic/option-chain", + }, + ], + }, + { + text: "进阶", + collapsable: false, + items: [ + { text: "状态管理(store)", link: "/guide/advance/store" }, + { text: "状态管理(pinia)", link: "/guide/advance/pinia" }, + { text: "使用 mixin", link: "/guide/advance/mixin" }, + { text: "使用 npm", link: "/guide/advance/npm" }, + { text: "使用分包", link: "/guide/advance/subpackage" }, + { text: "分包异步化", link: "/guide/advance/async-subpackage" }, + { text: "跨平台", link: "/guide/advance/platform" }, + { text: "国际化 i18n", link: "/guide/advance/i18n" }, + { text: "包体积分析", link: "/guide/advance/size-report" }, + { text: "图像资源处理", link: "/guide/advance/image-process" }, + { text: "原生渐进迁移", link: "/guide/advance/progressive" }, + { + text: "原生能力兼容", + link: "/guide/advance/ability-compatible", + }, + { text: "小程序插件", link: "/guide/advance/plugin" }, + { + text: "自定义路径", + link: "/guide/advance/custom-output-path", + }, + { + text: "使用原子类", + link: "/guide/advance/utility-first-css", + }, + { text: "SSR", link: "/guide/advance/ssr" }, + { + text: "依赖注入(Provide/Inject)", + link: "/guide/advance/provide-inject", + }, + { text: "编译配置", link: "/guide/advance/build-config" }, + ], + }, + { + text: "跨端", + collapsable: false, + items: [ + { text: "跨端输出基础", link: "/guide/platform/basic" }, + { text: "跨端输出 RN", link: "/guide/platform/rn" }, + ], + }, + { + text: "组合式 API", + collapsable: false, + items: [ + { + text: "组合式 API", + link: "/guide/composition-api/composition-api", + }, + { + text: "响应式 API", + link: "/guide/composition-api/reactive-api", + }, + ], + }, + { + text: "工具", + collapsable: false, + items: [ + { text: "使用TypeScript开发小程序", link: "/guide/tool/ts" }, + { text: "单元测试", link: "/guide/tool/unit-test" }, + { text: "E2E自动化测试", link: "/guide/tool/e2e-test" }, + ], + }, + { + text: "拓展", + collapsable: false, + items: [ + { text: "网络请求", link: "/guide/extend/fetch" }, + { text: "API 转换", link: "/guide/extend/api-proxy" }, + { text: "数据 Mock", link: "/guide/extend/mock" }, + ], + }, + { + text: "理解", + collapsable: false, + items: [ + { + text: "Mpx运行时增强原理", + link: "/guide/understand/runtime", + }, + { text: "Mpx编译构建原理", link: "/guide/understand/compile" }, + ], + }, + { + text: "迁移", + collapsable: false, + items: [ + { text: "从 2.8 升级至 2.9", link: "/guide/migrate/2.9" }, + { text: "从 2.7 升级至 2.8", link: "/guide/migrate/2.8" }, + { text: "从旧版本迁移至 2.7", link: "/guide/migrate/2.7" }, + { + text: "mpx-cli v2 迁移到 v3", + link: "/guide/migrate/mpx-cli-3", + }, + ], + }, + ], + "/api/": [ + { + text: "API", + collapsable: false, + items: [ + { text: "API 参考", link: "/api/" }, + { text: "全局配置", link: "/api/app-config" }, + { text: "全局 API", link: "/api/global-api" }, + { text: "实例 API", link: "/api/instance-api" }, + { text: "Store API", link: "/api/store-api" }, + { text: "模板指令", link: "/api/directives" }, + { text: "编译构建", link: "/api/compile" }, + { text: "内建组件", link: "/api/builtIn" }, + { text: "响应式 API", link: "/api/reactivity-api" }, + { text: "组合式 API", link: "/api/composition-api" }, + { text: "选项式 API", link: "/api/optional-api" }, + { text: "周边拓展", link: "/api/extend" }, + ], + }, + ], + "/articles/": [ + { + text: "文章", + collapsable: false, + items: [ + { text: "滴滴开源小程序框架Mpx", link: "/articles/1.0" }, + { + text: "Mpx 发布2.0,完美支持跨平台开发", + link: "/articles/2.0", + }, + { + text: "小程序框架运行时性能大测评", + link: "/articles/performance", + }, + { + text: "小程序开发者,为什么你应该尝试下MPX", + link: "/articles/mpx1", + }, + { text: "Mpx 小程序框架技术揭秘", link: "/articles/mpx2" }, + { + text: "滴滴出行小程序体积优化实践", + link: "/articles/size-control", + }, + { + text: "使用Typescript新特性Template Literal Types完善链式key的类型推导", + link: "/articles/ts-derivation", + }, + { + text: "Mpx2.7 版本正式发布,大幅提升编译构建速度", + link: "/articles/2.7-release", + }, + { + text: "Mpx2.8 版本正式发布,使用组合式 API 开发小程序", + link: "/articles/2.8-release", + }, + { + text: "Mpx2.9 版本正式发布,支持原子类、SSR 和包体积优化", + link: "/articles/2.9-release", + }, + { + text: "小程序跨端组件库 Mpx-cube-ui 开源啦", + link: "/articles/mpx-cube-ui", + }, + { + text: "@mpxjs/cli 插件化改造", + link: "/articles/mpx-cli-next", + }, + { + text: "Mpx 小程序单元测试能力建设与实践", + link: "/articles/unit-test", + }, + ], + }, + ], +} + +const algoliaTranslations = { + button: { + buttonText: "搜索", + }, + modal: { + searchBox: { + resetButtonTitle: "清除查询条件", + resetButtonAriaLabel: "清除查询条件", + cancelButtonText: "取消", + cancelButtonAriaLabel: "取消", + }, + startScreen: { + recentSearchesTitle: "搜索历史", + noRecentSearchesText: "没有搜索历史", + saveRecentSearchButtonTitle: "保存到搜索历史", + removeRecentSearchButtonTitle: "从搜索历史中移除", + favoriteSearchesTitle: "收藏", + removeFavoriteSearchButtonTitle: "从收藏中移除", + }, + errorScreen: { + titleText: "无法获取结果", + helpText: "你可能需要检查你的网络连接", + }, + footer: { + selectText: "选择", + navigateText: "切换", + closeText: "关闭", + searchByText: "搜索供应商", + }, + noResultsScreen: { + noResultsText: "无法找到相关结果", + suggestedQueryText: "你可以尝试查询", + reportMissingResultsText: "你认为这个查询应该有结果?", + reportMissingResultsLinkText: "向我们反馈", + }, + }, +} + +const i18n = { + search: '搜索', + menu: '菜单', + toc: '本页目录', + returnToTop: '返回顶部', + appearance: '外观', + previous: '前一篇', + next: '下一篇', + pageNotFound: '页面未找到', +} + +const ogUrl = "https://mpxjs.cn/" +const ogImage = `${ogUrl}logo.png` +const title = "Mpx 框架" +const description = "深度性能优化的增强型小程序开发框架" + +export default withPwa( + defineConfig({ + base: "/", + head: [ + ["link", { rel: "icon", href: "/favicon.ico" }], + [ + "script", + { type: "text/javascript" }, + `(function(c,l,a,r,i,t,y){ + c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; + t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; + y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); + })(window, document, "clarity", "script", "jtvvy52wxy");`, + ], + ["meta", { name: "author", content: title }], + ["meta", { property: "og:type", content: "website" }], + ["meta", { name: "og:title", content: title }], + ["meta", { name: "og:description", content: description }], + ["meta", { property: "og:image", content: ogImage }], + ["meta", { property: "og:url", content: ogUrl }], + ], + title, + locales: { + // 如果有其他语言,也可以在这里添加 + // '/zh/': { + // prev: '上一页', + // }, + "/": { + label: "中文", + lang: "zh-CN", // 将会被设置为 的 lang 属性 + title, + description, + }, + }, + ignoreDeadLinks: true, + pwa: { + base: "/", + scope: "/", + includeAssets: ["favicon.ico", "logo.png"], + manifest: { + name: title, + short_name: "Mpx", + description, + theme_color: "#ffffff", + }, + workbox: { + globPatterns: ["**/*.{css,js,html,svg,png,ico,txt,woff2}"], + }, + devOptions: { + enabled: false, + suppressWarnings: true, + navigateFallback: "/", + }, + }, + themeConfig: { + // navbar: false, + algolia: { + // apiKey: '7849f511f78afc4383a81f0137a91c0f', + appId: "DZ8S6HN0MP", + apiKey: "a34809e24ae1eb13ca3afc255d0a0cef", + indexName: "mpxjs", + placeholder: "搜索文档", + translations: algoliaTranslations, + }, + logo: "/favicon.ico", + socialLinks: [ + { icon: "github", link: "https://github.com/didi/mpx" }, + ], + nav: [ + { + text: "指南", + activeMatch: "^/guide/", + link: "/guide/basic/start", + }, + // 未来热门的链接可以用下面的折叠标题 + // { + // text: "文档", + // activeMatch: "^/guide/(basic/start|platform/basic)/", + // items: [ + // { text: "快速开始", link: "/guide/basic/start" }, + // { text: "跨端输出", link: "/guide/platform/basic" }, + // ], + // }, + { text: "API", activeMatch: "^/api/", link: "/api/" }, + { + text: "文章", + activeMatch: "^/articles/", + link: "/articles/", + }, + { + text: "更新记录", + activeMatch: "^/releases/", + link: "https://github.com/didi/mpx/releases", + target: "_blank", + }, + ], + outline: { + level: [2, 3], + label: "本页目录", + }, + sidebar, + darkModeSwitchLabel: "外观", + sidebarMenuLabel: "菜单", + returnToTopLabel: "返回顶部", + langMenuLabel: "语言", + notFound: { + title: "页面未找到", + linkText: "返回首页", + quote: "😩 抱歉,迷路了~" + }, + docFooter: { + prev: "上一页", + next: "下一页", + }, + }, + // @ts-ignore + chainWebpack: (config) => { + // 添加node_modules避免resolve错误 + config.resolve.modules.add("node_modules") + }, + }) +) diff --git a/docs-vitepress/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 new file mode 100644 index 0000000000..b6b603d596 Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-italic-cyrillic-ext.r48I6akx.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 new file mode 100644 index 0000000000..def40a4f65 Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-italic-cyrillic.By2_1cv3.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 new file mode 100644 index 0000000000..e070c3d309 Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-italic-greek-ext.1u6EdAuj.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 new file mode 100644 index 0000000000..a3c16ca40b Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-italic-greek.DJ8dCoTZ.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 new file mode 100644 index 0000000000..2210a899ed Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-italic-latin-ext.CN1xVJS-.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2 new file mode 100644 index 0000000000..790d62dc7b Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-italic-latin.C2AdPX0b.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 new file mode 100644 index 0000000000..1eec0775a6 Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-italic-vietnamese.BSbpV94h.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 new file mode 100644 index 0000000000..2cfe61536e Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-roman-cyrillic-ext.BBPuwvHQ.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 new file mode 100644 index 0000000000..e3886dd141 Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-roman-cyrillic.C5lxZ8CY.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 new file mode 100644 index 0000000000..36d67487dc Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-roman-greek-ext.CqjqNYQ-.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2 new file mode 100644 index 0000000000..2bed1e85e8 Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-roman-greek.BBVDIX6e.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 new file mode 100644 index 0000000000..9a8d1e2b5e Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-roman-latin-ext.4ZJIpNVo.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2 new file mode 100644 index 0000000000..07d3c53aef Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-roman-latin.Di8DUHzh.woff2 differ diff --git a/docs-vitepress/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 b/docs-vitepress/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 new file mode 100644 index 0000000000..57bdc22ae8 Binary files /dev/null and b/docs-vitepress/.vitepress/dist/assets/inter-roman-vietnamese.BjW4sHH5.woff2 differ diff --git a/docs-vuepress/assets/images/start-tips1.png b/docs-vitepress/.vitepress/dist/assets/start-tips1.B10pt_bp.png similarity index 100% rename from docs-vuepress/assets/images/start-tips1.png rename to docs-vitepress/.vitepress/dist/assets/start-tips1.B10pt_bp.png diff --git a/docs-vuepress/assets/images/start-tips2.png b/docs-vitepress/.vitepress/dist/assets/start-tips2.DL_IWEZM.png similarity index 100% rename from docs-vuepress/assets/images/start-tips2.png rename to docs-vitepress/.vitepress/dist/assets/start-tips2.DL_IWEZM.png diff --git a/docs-vuepress/.vuepress/theme/components/AlgoliaSearchBox.vue b/docs-vitepress/.vitepress/theme/components/AlgoliaSearchBox.vue similarity index 100% rename from docs-vuepress/.vuepress/theme/components/AlgoliaSearchBox.vue rename to docs-vitepress/.vitepress/theme/components/AlgoliaSearchBox.vue diff --git a/docs-vuepress/.vuepress/theme/components/CodeList.vue b/docs-vitepress/.vitepress/theme/components/CodeList.vue similarity index 93% rename from docs-vuepress/.vuepress/theme/components/CodeList.vue rename to docs-vitepress/.vitepress/theme/components/CodeList.vue index ac50a20d70..9d13f6c604 100644 --- a/docs-vuepress/.vuepress/theme/components/CodeList.vue +++ b/docs-vitepress/.vitepress/theme/components/CodeList.vue @@ -9,7 +9,7 @@ --> - code + code diff --git a/docs-vuepress/.vuepress/theme/components/MobileSwiper.vue b/docs-vitepress/.vitepress/theme/components/MobileSwiper.vue similarity index 95% rename from docs-vuepress/.vuepress/theme/components/MobileSwiper.vue rename to docs-vitepress/.vitepress/theme/components/MobileSwiper.vue index 3d7c7ac4b0..7ec8c9eb3b 100644 --- a/docs-vuepress/.vuepress/theme/components/MobileSwiper.vue +++ b/docs-vitepress/.vitepress/theme/components/MobileSwiper.vue @@ -1,6 +1,6 @@ @@ -127,6 +147,7 @@ export default { .header-menu { width: 100%; + height: 60px; display: flex; align-items: center; justify-content: space-between; @@ -235,7 +256,7 @@ a.router-link-active { height: 60px; line-height: 60px; padding: 0 16px; - display: flex + display: flex; align-items: center; justify-content: space-between; box-sizing: border-box; diff --git a/docs-vuepress/.vuepress/theme/components/Popover.vue b/docs-vitepress/.vitepress/theme/components/Popover.vue similarity index 100% rename from docs-vuepress/.vuepress/theme/components/Popover.vue rename to docs-vitepress/.vitepress/theme/components/Popover.vue diff --git a/docs-vitepress/.vitepress/theme/components/RegisterSW.vue b/docs-vitepress/.vitepress/theme/components/RegisterSW.vue new file mode 100644 index 0000000000..705ced5dd9 --- /dev/null +++ b/docs-vitepress/.vitepress/theme/components/RegisterSW.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/docs-vuepress/.vuepress/theme/components/SlideItem.vue b/docs-vitepress/.vitepress/theme/components/SlideItem.vue similarity index 100% rename from docs-vuepress/.vuepress/theme/components/SlideItem.vue rename to docs-vitepress/.vitepress/theme/components/SlideItem.vue diff --git a/docs-vuepress/.vuepress/theme/components/Swiper.vue b/docs-vitepress/.vitepress/theme/components/Swiper.vue similarity index 94% rename from docs-vuepress/.vuepress/theme/components/Swiper.vue rename to docs-vitepress/.vitepress/theme/components/Swiper.vue index a48e1347ce..5c0f381148 100644 --- a/docs-vuepress/.vuepress/theme/components/Swiper.vue +++ b/docs-vitepress/.vitepress/theme/components/Swiper.vue @@ -1,7 +1,7 @@ diff --git a/docs-vuepress/.vuepress/theme/components/SwiperImg.vue b/docs-vitepress/.vitepress/theme/components/SwiperImg.vue similarity index 90% rename from docs-vuepress/.vuepress/theme/components/SwiperImg.vue rename to docs-vitepress/.vitepress/theme/components/SwiperImg.vue index c2409843d3..319a44930d 100644 --- a/docs-vuepress/.vuepress/theme/components/SwiperImg.vue +++ b/docs-vitepress/.vitepress/theme/components/SwiperImg.vue @@ -2,7 +2,7 @@
- img + img
diff --git a/docs-vuepress/.vuepress/theme/global-components/Content.vue b/docs-vitepress/.vitepress/theme/global-components/Content.vue similarity index 83% rename from docs-vuepress/.vuepress/theme/global-components/Content.vue rename to docs-vitepress/.vitepress/theme/global-components/Content.vue index f204c5a218..67644b55df 100644 --- a/docs-vuepress/.vuepress/theme/global-components/Content.vue +++ b/docs-vitepress/.vitepress/theme/global-components/Content.vue @@ -7,18 +7,18 @@
-

{{$page.frontmatter.heroText}}

+

{{$frontmatter.heroText}}

- {{$page.frontmatter.tagline}} + {{$frontmatter.tagline}}

@@ -29,8 +29,8 @@
    -
  • - svg +
  • + svg

    {{item.title}}

    {{item.details}}

    @@ -39,26 +39,26 @@
-
+
phone + width="410" + style="height: 712px;" + src="https://dpubstatic.udache.com/static/dpubimg/Vx5n_3YCtP/anli_pic_phone.png" + alt="phone" + loading="lazy" />
@@ -66,9 +66,9 @@
-

{{$page.frontmatter.threeSection.title}}

+

{{$frontmatter.threeSection.title}}

- + 扫码体验Mpx版本的 todoMVC 在各个小程序平台和web中的一致表现 ,更多示例项目可点击 @@ -77,8 +77,8 @@

@@ -88,13 +88,13 @@
-
+
svg
@@ -102,14 +102,14 @@
-

{{$page.frontmatter.fourSection.title}}

+

{{$frontmatter.fourSection && $frontmatter.fourSection.title}}

- {{$page.frontmatter.fourSection.details}} + {{$frontmatter.fourSection.details}}

@@ -119,21 +119,21 @@
-
+
-

{{$page.frontmatter.fiveSection.title}}

+

{{$frontmatter.fiveSection.title}}

- {{$page.frontmatter.fiveSection.details}} + {{$frontmatter.fiveSection.details}}

@@ -141,7 +141,7 @@
svg
@@ -150,17 +150,17 @@
-
+
-

{{$page.frontmatter.sixSection.title}}

+

{{$frontmatter.sixSection.title}}

  • - svg + svg
    {{item.title}}
    @@ -175,7 +175,7 @@
    -

    {{$page.frontmatter.sevenSection.title}}

    +

    {{$frontmatter.sevenSection.title}}

    @@ -184,11 +184,11 @@

    -
    +
    phone @@ -208,6 +208,8 @@ import Swiper from '../components/Swiper.vue'; import SwiperImg from '../components/SwiperImg.vue'; import CodeList from '../components/CodeList.vue'; +import { useData } from 'vitepress' +import { toRefs } from 'vue' export default { data () { @@ -218,7 +220,7 @@ export default { computed: { list () { let result = [] - let details = this.$page.frontmatter.sixSection.details + let details = this.$frontmatter.sixSection.details let current = [] let i = 0 while (i < details.length) { @@ -231,13 +233,11 @@ export default { } return result }, - dataList () { - const list = this.$page.frontmatter.sevenSection.details - return list - }, mvcList () { - const list = this.$page.frontmatter.threeSection.list - return list + return this.$frontmatter.threeSection.list + }, + dataList () { + return this.$frontmatter.sevenSection.details }, currentTitle () { return this.dataList[this.currentIndex].title diff --git a/docs-vuepress/.vuepress/theme/global-components/Footer.vue b/docs-vitepress/.vitepress/theme/global-components/Footer.vue similarity index 79% rename from docs-vuepress/.vuepress/theme/global-components/Footer.vue rename to docs-vitepress/.vitepress/theme/global-components/Footer.vue index e96e4cca1a..96535a8ef6 100644 --- a/docs-vuepress/.vuepress/theme/global-components/Footer.vue +++ b/docs-vitepress/.vitepress/theme/global-components/Footer.vue @@ -12,9 +12,9 @@
  • @@ -22,9 +22,9 @@