Skip to content

Commit e1a28b9

Browse files
committed
chore: use vitepress-plugin-component-demo and update packages
1 parent 0d4d6b2 commit e1a28b9

File tree

12 files changed

+501
-470
lines changed

12 files changed

+501
-470
lines changed

docs/.vitepress/components/Demo.vue

Lines changed: 0 additions & 86 deletions
This file was deleted.

docs/.vitepress/components/ScrollLoad.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,11 @@ const load = () => {
4545
}
4646
};
4747
</script>
48+
49+
<style lang="scss" scoped>
50+
.el-table {
51+
:deep(table) {
52+
margin: 0;
53+
}
54+
}
55+
</style>

docs/.vitepress/components/index.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/.vitepress/components/raws-generate.mjs

Lines changed: 0 additions & 43 deletions
This file was deleted.

docs/.vitepress/components/raws-generate.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/.vitepress/components/raws.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/.vitepress/config.mts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
1-
import path from 'path';
2-
import { defineConfig } from 'vitepress';
1+
import path from "path";
2+
import { defineConfig } from "vitepress";
3+
import vitePluginDemo from "vitepress-plugin-component-demo/vite-plugin";
34

45
export default defineConfig({
56
appearance: true,
6-
base: '/el-table-infinite-scroll/',
7-
title: 'el-table-infinite-scroll',
8-
description: 'infinite scroll for el-table.',
7+
base: "/el-table-infinite-scroll/",
8+
title: "el-table-infinite-scroll",
9+
description: "infinite scroll for el-table.",
10+
lastUpdated: true,
911

1012
themeConfig: {
11-
logo: '/logo.svg',
12-
nav: [{ text: 'Guide', link: '/' }],
13+
logo: "/logo.svg",
14+
nav: [{ text: "Guide", link: "/" }],
1315
search: {
14-
provider: 'local',
16+
provider: "local",
1517
},
1618
socialLinks: [
1719
{
18-
icon: 'github',
19-
link: 'https://github.com/yujinpan/el-table-infinite-scroll',
20+
icon: "github",
21+
link: "https://github.com/yujinpan/el-table-infinite-scroll",
2022
},
2123
],
2224
footer: {
23-
message: 'Released under the MIT License.',
24-
copyright: 'Copyright © 2019-2022 yujinpan',
25+
message: "Released under the MIT License.",
26+
copyright: "Copyright © 2019-2022 yujinpan",
2527
},
26-
lastUpdatedText: 'Updated Date',
2728
},
2829

2930
vite: {
3031
resolve: {
3132
alias: {
32-
'@': path.resolve(__dirname, '../../src'),
33+
"@": path.resolve(__dirname, "../../src"),
3334
},
3435
},
36+
plugins: [vitePluginDemo()],
3537
},
3638

3739
async transformHtml(code) {
3840
return code.replace(
39-
'</body>',
41+
"</body>",
4042
`
4143
<!-- Google tag (gtag.js) -->
4244
<script async src="https://www.googletagmanager.com/gtag/js?id=G-S66MPLRFJZ"></script>

docs/.vitepress/theme/index.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
import type { EnhanceAppContext } from 'vitepress';
21
import DefaultTheme from 'vitepress/theme';
3-
import ElTableInfiniteScroll from '@/index';
2+
import { enhanceApp } from 'vitepress-plugin-component-demo';
3+
4+
import type { EnhanceAppContext } from 'vitepress';
45

56
import { install as installElementPlus } from './element-plus';
6-
import { install as installComponents } from '../components';
7+
import ElTableInfiniteScroll from '@/index';
78

89
export default {
910
...DefaultTheme,
10-
enhanceApp({ app }: EnhanceAppContext) {
11+
enhanceApp(context: EnhanceAppContext) {
12+
const { app } = context;
13+
14+
enhanceApp(context);
15+
1116
app.use(ElTableInfiniteScroll);
1217

1318
installElementPlus(app);
14-
installComponents(app);
1519
},
1620
};

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import { default as vElTableInfiniteScroll } from "el-table-infinite-scroll";
4646

4747
Scroll table to bottom to load paginated data.
4848

49-
<Demo component="ScrollLoad" />
49+
<demo name="ScrollLoad" />
5050

5151
## Options
5252

docs/public/logo.svg

Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)