diff --git a/.vitepress/components/demo.vue b/.vitepress/components/demo.vue new file mode 100644 index 0000000..31ae85b --- /dev/null +++ b/.vitepress/components/demo.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/.vitepress/config.ts b/.vitepress/config.ts index e79fbb0..ee8cdb9 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -10,20 +10,19 @@ const baseSrc = fileURLToPath(new URL('./', import.meta.url)) export default defineConfig({ rewrites: getRewrites(), - mpa: true, lang: 'en-US', ignoreDeadLinks: true, locales: { 'zh-CN': { lang: 'zh-CN', - title: 'vue3组件库站点', + title: 'Antd Tiny Vue', label: '简体中文', description: 'vue3组件库站点', themeConfig: getZhCNConfig() }, root: { lang: 'en-US', - title: 'vue3 component library site', + title: 'Antd Tiny Vue', label: 'English', description: 'vue3 component library site', themeConfig: getEnUSConfig() diff --git a/.vitepress/theme/index.ts b/.vitepress/theme/index.ts index db01a6a..e06495f 100644 --- a/.vitepress/theme/index.ts +++ b/.vitepress/theme/index.ts @@ -1,15 +1,17 @@ import type { Theme } from 'vitepress' // eslint-disable-next-line import/no-named-as-default import DefaultTheme from 'vitepress/theme' -import { AntdTheme } from 'vite-plugin-vitepress-demo/theme' -// @ts-expect-error this is a local module -import Antd from 'antd-tiny-vue' - +import AntdTheme from '../components/demo.vue' export default { ...DefaultTheme, - enhanceApp(ctx) { + async enhanceApp(ctx) { DefaultTheme.enhanceApp?.(ctx) ctx.app.component('Demo', AntdTheme) - ctx.app.use(Antd) + // @ts-expect-error this is a local module + if (!import.meta.env.SSR) { + // @ts-expect-error this is a local module + const Antd = (await import('antd-tiny-vue')).default + ctx.app.use(Antd) + } } } as Theme diff --git a/components/button/style/index.ts b/components/button/style/index.ts index 70aa3ec..2095e0b 100644 --- a/components/button/style/index.ts +++ b/components/button/style/index.ts @@ -20,7 +20,6 @@ const genSharedButtonStyle: GenerateStyle = ( token ): CSSObject => { const { componentCls, iconCls } = token - return { [componentCls]: { outline: 'none', diff --git a/package.json b/package.json index 994b53d..62a2e69 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,9 @@ "packageManager": "pnpm@8.2.0", "dependencies": { "@ant-design/colors": "^7.0.0", - "@antd-tiny-vue/cssinjs": "^0.0.4", + "@antd-tiny-vue/cssinjs": "0.0.8", "@ctrl/tinycolor": "^3.6.0", - "@v-c/utils": "^0.0.19", + "@v-c/utils": "^0.0.22", "@vueuse/core": "^9.13.0", "vue": "^3.2.47" }, @@ -44,7 +44,7 @@ "typescript": "^4.9.5", "unbuild": "^1.1.2", "vite": "^4.2.1", - "vite-plugin-vitepress-demo": "2.0.0-beta.28", + "vite-plugin-vitepress-demo": "2.0.0-beta.29", "vitepress": "1.0.0-alpha.69", "vitest": "^0.28.5" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27a0415..6b903e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,14 +5,14 @@ dependencies: specifier: ^7.0.0 version: 7.0.0 '@antd-tiny-vue/cssinjs': - specifier: ^0.0.4 - version: 0.0.4(vue@3.2.47) + specifier: 0.0.8 + version: 0.0.8(vue@3.2.47) '@ctrl/tinycolor': specifier: ^3.6.0 version: 3.6.0 '@v-c/utils': - specifier: ^0.0.19 - version: 0.0.19 + specifier: ^0.0.22 + version: 0.0.22 '@vueuse/core': specifier: ^9.13.0 version: 9.13.0(vue@3.2.47) @@ -64,8 +64,8 @@ devDependencies: specifier: ^4.2.1 version: 4.2.1(@types/node@18.15.10) vite-plugin-vitepress-demo: - specifier: 2.0.0-beta.28 - version: 2.0.0-beta.28(vitepress@1.0.0-alpha.69) + specifier: 2.0.0-beta.29 + version: 2.0.0-beta.29(vitepress@1.0.0-alpha.69) vitepress: specifier: 1.0.0-alpha.69 version: 1.0.0-alpha.69(@types/node@18.15.10) @@ -202,8 +202,8 @@ packages: '@ctrl/tinycolor': 3.6.0 dev: false - /@antd-tiny-vue/cssinjs@0.0.4(vue@3.2.47): - resolution: {integrity: sha512-o6eU9IN+nfzaeCLHaQ94FqgvZV7eHeyY/Qw0p7ETMOyEQup13LBb4feOQKHGtBKLRkeoTugpY6EhAuMhn10SYw==} + /@antd-tiny-vue/cssinjs@0.0.8(vue@3.2.47): + resolution: {integrity: sha512-Q5/4ugRfaIn0jfG/D5eXu2DtGfmMbsNAvAcx6M0aRjY3gfvd4h/W7YDIfI4N9lfighnvJ8A4CgW6d9xAHlP5pw==} peerDependencies: vue: ^3.2.0 dependencies: @@ -1436,8 +1436,8 @@ packages: eslint-visitor-keys: 3.3.0 dev: true - /@v-c/utils@0.0.19: - resolution: {integrity: sha512-f+ZifqMUCY7UsP1+Z7FZIq8bxE+2CDTaF69NQFfBJw/z6EC+oJEX7HXaVqliYXW+JM20Qfq6x4huNXjJXdDkMQ==} + /@v-c/utils@0.0.22: + resolution: {integrity: sha512-fkFIpo6jAJ2CxQXFyd3woLHmBwHkWiOSA29eul0a2eWyRKtsESwRMVNAvis+hCKwexzLHY80wxlvWxpn3OCjbQ==} dependencies: lodash.clonedeep: 4.5.0 lodash.isequal: 4.5.0 @@ -5054,8 +5054,8 @@ packages: - terser dev: true - /vite-plugin-vitepress-demo@2.0.0-beta.28(vitepress@1.0.0-alpha.69): - resolution: {integrity: sha512-Js/plBl72fPoHv00VJYo33v5YnbhWzLK2bwzCZ1+H28bS+JmdMVBa8SnMy8GAFiZgpAEudLf55sRlQY4BGCv2Q==} + /vite-plugin-vitepress-demo@2.0.0-beta.29(vitepress@1.0.0-alpha.69): + resolution: {integrity: sha512-9AvlF5Bz6kMfkvlLDdcuv/Xz9Va/HRuh8YCpwiz3NKeIo+BnZ6ehn7tc/Wj/RVH2XZlJTUNyEvMOvIwNlzY2sw==} peerDependencies: vitepress: ^1.0.0-alpha.63 dependencies: