diff --git a/site/docs/.vuepress/client.js b/site/docs/.vuepress/client.js index 56feb6261..3757a9c46 100644 --- a/site/docs/.vuepress/client.js +++ b/site/docs/.vuepress/client.js @@ -1,7 +1,9 @@ -import { defineClientConfig } from "@vuepress/client"; -import { usePageData } from "@vuepress/client"; import oldContributorsData from "./oldContributorsData.json"; +import { usePageData } from "@vuepress/client"; +import { defineClientConfig } from "@vuepress/client"; +import CountTo from "vue-count-to/src/vue-countTo.vue"; + const addOldDocsContributors = () => { const page = usePageData(); if (!page.value.git) return; @@ -33,13 +35,18 @@ const addOldDocsContributors = () => { }; export default defineClientConfig({ - enhance({ router }) { + enhance({ router, app }) { + // register global components + app.component("CountTo", CountTo); + + // add old docs contributors router.afterEach((to, from) => { if (to.fullPath !== from.fullPath) { addOldDocsContributors(); } }); + // baidu analytics router.beforeEach((to, from, next) => { if (typeof _hmt != "undefined") { if (to.path && to.fullPath !== from.fullPath) { diff --git a/site/docs/.vuepress/config.js b/site/docs/.vuepress/config.js index a7f467770..e40adb331 100644 --- a/site/docs/.vuepress/config.js +++ b/site/docs/.vuepress/config.js @@ -113,7 +113,6 @@ module.exports = { }), activeHeaderLinksPlugin({ headerLinkSelector: "div.right-menu-item > a", - delay: 0, }), docsearchPlugin({ apiKey: "30c521836bfc8e97915576e11ac2cebc", diff --git a/site/docs/.vuepress/styles/index.scss b/site/docs/.vuepress/styles/index.scss index 4a7f6b74e..10c633dc5 100644 --- a/site/docs/.vuepress/styles/index.scss +++ b/site/docs/.vuepress/styles/index.scss @@ -1,5 +1,6 @@ :root { --sidebar-width: 17rem; + scroll-behavior: smooth; } .site-name.can-hide { diff --git a/site/docs/.vuepress/theme/components/Badge.vue b/site/docs/.vuepress/theme/components/Badge.vue index b5b261170..9ed37462a 100644 --- a/site/docs/.vuepress/theme/components/Badge.vue +++ b/site/docs/.vuepress/theme/components/Badge.vue @@ -2,13 +2,12 @@   - {{ number }} + -