Skip to content

Commit b14b7af

Browse files
chore: clean up vue examples (#4775)
* Add Vue server-side pagination example * Update package.json and tsconfig for new example * Use table state functions for pagination * Use separate ref for goToPageNumber input * rm lock * clean up vue examples * run prettier * add vue pagination example to docs site --------- Co-authored-by: Radu Suciu <[email protected]>
1 parent 15596f3 commit b14b7af

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+850
-908
lines changed

docs/config.json

+4
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@
347347
"to": "examples/vue/column-pinning",
348348
"label": "Column Pinning"
349349
},
350+
{
351+
"to": "examples/vue/pagination",
352+
"label": "Pagination"
353+
},
350354
{
351355
"to": "examples/vue/sorting",
352356
"label": "Sorting"

examples/vue/basic/env.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="vite/client" />

examples/vue/basic/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
"preview": "vite preview"
99
},
1010
"dependencies": {
11-
"vue": "^3.2.25",
11+
"vue": "^3.2.33",
1212
"@tanstack/vue-table": "8.8.2"
1313
},
1414
"devDependencies": {
15+
"@types/node": "^16.11.27",
1516
"@vitejs/plugin-vue": "^2.3.3",
1617
"typescript": "^4.5.4",
1718
"vite": "^2.9.9",

examples/vue/basic/tsconfig.dev.json

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
{
22
"extends": "../../../tsconfig.base.json",
33
"compilerOptions": {
4-
"outDir": "./build/types"
4+
"outDir": "./build/types",
5+
"types": [
6+
"vite/client"
7+
]
58
},
6-
"files": ["src/main.ts"],
9+
"files": [
10+
"src/main.ts"
11+
],
712
"include": [
813
"src"
914
// "__tests__/**/*.test.*"
1015
]
1116
}
12-
1317
// {
1418
// "composite": true,
1519
// "compilerOptions": {
@@ -28,4 +32,4 @@
2832
// },
2933
// "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
3034
// "references": [{ "path": "./tsconfig.node.json" }]
31-
// }
35+
// }

examples/vue/column-ordering/package.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "column-ordering",
2+
"name": "tanstack-table-example-vue-column-ordering",
33
"version": "0.0.0",
44
"scripts": {
55
"dev": "vite",
@@ -14,10 +14,9 @@
1414
},
1515
"devDependencies": {
1616
"@types/node": "^16.11.27",
17-
"@vitejs/plugin-vue": "^2.3.1",
18-
"@vue/tsconfig": "^0.1.3",
19-
"typescript": "~4.6.3",
20-
"vite": "^2.9.5",
17+
"@vitejs/plugin-vue": "^2.3.3",
18+
"typescript": "^4.5.4",
19+
"vite": "^2.9.9",
2120
"vue-tsc": "^0.34.7"
2221
}
23-
}
22+
}

examples/vue/column-ordering/src/main.js

-4
This file was deleted.
-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { createApp } from 'vue'
2-
// @ts-ignore
32
import App from './App.vue'
43

54
createApp(App).mount('#app')

examples/vue/column-ordering/src/makeData.js

-34
This file was deleted.
+30-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11
{
2-
"extends": "@vue/tsconfig/tsconfig.web.json",
3-
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
2+
"extends": "../../../tsconfig.base.json",
43
"compilerOptions": {
5-
"baseUrl": ".",
6-
"paths": {
7-
"@/*": ["./src/*"]
8-
}
4+
"outDir": "./build/types",
5+
"types": [
6+
"vite/client"
7+
]
98
},
10-
11-
"references": [
12-
{
13-
"path": "./tsconfig.vite-config.json"
14-
}
9+
"files": [
10+
"src/main.ts"
11+
],
12+
"include": [
13+
"src"
14+
// "__tests__/**/*.test.*"
1515
]
1616
}
17+
// {
18+
// "composite": true,
19+
// "compilerOptions": {
20+
// "target": "esnext",
21+
// "useDefineForClassFields": true,
22+
// "module": "esnext",
23+
// "moduleResolution": "node",
24+
// "strict": true,
25+
// "jsx": "preserve",
26+
// "sourceMap": true,
27+
// "resolveJsonModule": true,
28+
// "isolatedModules": true,
29+
// "esModuleInterop": true,
30+
// "lib": ["esnext", "dom"],
31+
// "skipLibCheck": true
32+
// },
33+
// "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
34+
// "references": [{ "path": "./tsconfig.node.json" }]
35+
// }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"module": "esnext",
5+
"moduleResolution": "node"
6+
},
7+
"include": ["vite.config.ts"]
8+
}

examples/vue/column-ordering/tsconfig.vite-config.json

-8
This file was deleted.

examples/vue/column-ordering/vite.config.d.ts

-2
This file was deleted.

examples/vue/column-ordering/vite.config.js

-12
This file was deleted.
+1-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
import { fileURLToPath, URL } from 'url'
2-
31
import { defineConfig } from 'vite'
42
import vue from '@vitejs/plugin-vue'
53

64
// https://vitejs.dev/config/
75
export default defineConfig({
8-
plugins: [vue() as any],
9-
resolve: {
10-
alias: {
11-
'@': fileURLToPath(new URL('./src', import.meta.url)),
12-
},
13-
},
6+
plugins: [vue()],
147
})

examples/vue/column-pinning/package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "column-pinning",
2+
"name": "tanstack-table-example-vue-column-pinning",
33
"version": "0.0.0",
44
"scripts": {
55
"dev": "vite",
@@ -14,10 +14,9 @@
1414
},
1515
"devDependencies": {
1616
"@types/node": "^16.11.27",
17-
"@vitejs/plugin-vue": "^2.3.1",
18-
"@vue/tsconfig": "^0.1.3",
19-
"typescript": "~4.6.3",
20-
"vite": "^2.9.5",
17+
"@vitejs/plugin-vue": "^2.3.3",
18+
"typescript": "^4.5.4",
19+
"vite": "^2.9.9",
2120
"vue-tsc": "^0.34.7"
2221
}
2322
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference types="vite/client" />
2+
3+
declare module '*.vue' {
4+
import type { DefineComponent } from 'vue'
5+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
6+
const component: DefineComponent<{}, {}, any>
7+
export default component
8+
}

examples/vue/column-pinning/src/main.js

-4
This file was deleted.
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { createApp } from 'vue'
2-
// @ts-ignore
32
import App from './App.vue'
3+
44
createApp(App).mount('#app')

examples/vue/column-pinning/src/makeData.js

-34
This file was deleted.
+30-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11
{
2-
"extends": "@vue/tsconfig/tsconfig.web.json",
3-
"include": ["env.d.ts", "src/**/*", "src/**/*.vue"],
2+
"extends": "../../../tsconfig.base.json",
43
"compilerOptions": {
5-
"baseUrl": ".",
6-
"paths": {
7-
"@/*": ["./src/*"]
8-
}
4+
"outDir": "./build/types",
5+
"types": [
6+
"vite/client"
7+
]
98
},
10-
11-
"references": [
12-
{
13-
"path": "./tsconfig.vite-config.json"
14-
}
9+
"files": [
10+
"src/main.ts"
11+
],
12+
"include": [
13+
"src"
14+
// "__tests__/**/*.test.*"
1515
]
1616
}
17+
// {
18+
// "composite": true,
19+
// "compilerOptions": {
20+
// "target": "esnext",
21+
// "useDefineForClassFields": true,
22+
// "module": "esnext",
23+
// "moduleResolution": "node",
24+
// "strict": true,
25+
// "jsx": "preserve",
26+
// "sourceMap": true,
27+
// "resolveJsonModule": true,
28+
// "isolatedModules": true,
29+
// "esModuleInterop": true,
30+
// "lib": ["esnext", "dom"],
31+
// "skipLibCheck": true
32+
// },
33+
// "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
34+
// "references": [{ "path": "./tsconfig.node.json" }]
35+
// }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"module": "esnext",
5+
"moduleResolution": "node"
6+
},
7+
"include": ["vite.config.ts"]
8+
}

examples/vue/column-pinning/tsconfig.vite-config.json

-8
This file was deleted.

examples/vue/column-pinning/vite.config.d.ts

-2
This file was deleted.

examples/vue/column-pinning/vite.config.js

-12
This file was deleted.
+1-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
import { fileURLToPath, URL } from 'url'
2-
31
import { defineConfig } from 'vite'
42
import vue from '@vitejs/plugin-vue'
53

64
// https://vitejs.dev/config/
75
export default defineConfig({
8-
plugins: [vue() as any],
9-
resolve: {
10-
alias: {
11-
'@': fileURLToPath(new URL('./src', import.meta.url)),
12-
},
13-
},
6+
plugins: [vue()],
147
})

0 commit comments

Comments
 (0)