From 3670ae3ae759ce2291a547a04843bcdffe987bc9 Mon Sep 17 00:00:00 2001 From: mxf <547087214@qq.com> Date: Thu, 31 Aug 2023 16:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8B=A6=E6=88=AA=E5=99=A8?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E7=94=A8apifox=E6=A8=A1=E6=8B=9F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 +- src/components/my-table.vue | 11 +- src/demo/index.vue | 39 ++++ src/demo/my-table-demo.vue | 184 ++++++++++-------- src/demo/my-table.d.ts | 12 ++ src/service/api.ts | 6 + src/service/axios.ts | 10 - src/service/interceptors.ts | 35 +++- src/service/request.ts | 32 +++ .../auto-import/auto-import-components.d.ts | 1 + src/types/auto-import/auto-import.d.ts | 1 + src/types/my-table.d.ts | 24 +-- tsconfig.app.json | 1 + vite.config.ts | 3 + 14 files changed, 256 insertions(+), 106 deletions(-) create mode 100644 src/demo/my-table.d.ts create mode 100644 src/service/api.ts delete mode 100644 src/service/axios.ts create mode 100644 src/service/request.ts diff --git a/package.json b/package.json index dbb564a..8dc65ac 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "dev": "vite", "preview": "vite preview", "build": "vite build", - "deploy": "push-dir --dir=dist --branch=gh-pages --cleanup" + "deploy": "push-dir --dir=dist --branch=gh-pages --cleanup", + "test": "rm -rf dist && echo 'del success' " }, "dependencies": { "@types/lodash": "^4.14.195", diff --git a/src/components/my-table.vue b/src/components/my-table.vue index 121adc6..67e2e4f 100644 --- a/src/components/my-table.vue +++ b/src/components/my-table.vue @@ -27,7 +27,7 @@ import type {isShowType} from '../types/my-table.d' }) console.log(props,'props'); - const emits = defineEmits(['selectChange','pagination']) + const emits = defineEmits(['selectChange','paginationFn']) // const pageSize = ref(props.limit) // const currentPage = ref(props.pageNum) @@ -58,11 +58,11 @@ import type {isShowType} from '../types/my-table.d' } const currentChange = (val:number) => { // currentPage.value = val - emits('pagination',{pageNum:val,pageSize:pageSize.value}) + emits('paginationFn',{pageNum:val,pageSize:pageSize.value}) } const sizeChange = (val:number) => { // pageSize.value = val - emits('pagination',{pageSize:val,pageNum:currentPage.value}) + emits('paginationFn',{pageSize:val,pageNum:currentPage.value}) } @@ -99,7 +99,12 @@ import type {isShowType} from '../types/my-table.d' + + +