Skip to content

Commit 12aa8b6

Browse files
committed
feat: update
1 parent 1708c68 commit 12aa8b6

File tree

8 files changed

+156
-15
lines changed

8 files changed

+156
-15
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Install and Build 🔧
2626
uses: actions/[email protected]
2727
with:
28-
node-version: '16.x'
28+
node-version: '18.x'
2929
cache: pnpm
3030
- run: pnpm i
3131
- run: pnpm run docs:build

.vitepress/config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { resolve } from 'node:path'
22
import { componentPreview, containerPreview } from '@vitepress-demo-preview/plugin'
33
import Unocss from 'unocss/vite'
4+
import AutoImport from 'unplugin-auto-import/vite'
5+
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
6+
import Components from 'unplugin-vue-components/vite'
47
import { defineConfig } from 'vitepress'
58

69
import nav from './nav'
@@ -46,8 +49,18 @@ export default defineConfig({
4649
vite: {
4750
resolve: { alias: { 'coding-playground': resolve(__dirname, '../packages') } },
4851
plugins: [
49-
// @ts-expect-error unocss返回类型错误
52+
AutoImport({
53+
dts: true,
54+
resolvers: [ElementPlusResolver()],
55+
}),
56+
Components({
57+
dts: true,
58+
resolvers: [ElementPlusResolver()],
59+
}),
5060
Unocss(),
5161
],
62+
ssr: {
63+
noExternal: [/element-plus/],
64+
},
5265
},
5366
})

auto-imports.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* eslint-disable */
2+
/* prettier-ignore */
3+
// @ts-nocheck
4+
// noinspection JSUnusedGlobalSymbols
5+
// Generated by unplugin-auto-import
6+
// biome-ignore lint: disable
7+
export {}
8+
declare global {
9+
10+
}

components.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
// Generated by unplugin-vue-components
4+
// Read more: https://github.com/vuejs/core/pull/3399
5+
// biome-ignore lint: disable
6+
export {}
7+
8+
/* prettier-ignore */
9+
declare module 'vue' {
10+
export interface GlobalComponents {
11+
ElSwitch: typeof import('element-plus/es')['ElSwitch']
12+
}
13+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
"ts-loader": "^9.5.2",
4444
"typescript": "^5.8.2",
4545
"unocss": "^66.0.0",
46+
"unplugin-auto-import": "^19.1.1",
47+
"unplugin-vue-components": "^28.4.1",
4648
"vite": "^6.2.2",
4749
"vitepress": "1.6.3",
4850
"vue-tsc": "^2.2.8"

packages/performance/useDefer/demo.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
</template>
1616

1717
<script setup lang="ts">
18-
import { ElSwitch } from 'element-plus'
1918
import { onMounted, ref, watch } from 'vue'
20-
import 'element-plus/es/components/switch/style/css'
2119
2220
/**
2321
* 延迟渲染组件的钩子函数

packages/performance/useDefer/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ Vue3性能优化Hook,用于大量组件的延迟渲染。通过requestAnimatio
66

77
## 示例
88

9+
<client-only>
10+
911
:::preview 说明 || useDefer
1012

1113
demo-preview=./demo.vue
1214

1315
:::
16+
17+
</client-only>

pnpm-lock.yaml

Lines changed: 112 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)