Skip to content

Commit 7ae2eb4

Browse files
committed
封装虚拟表格 tableV2
1 parent 6e9d96a commit 7ae2eb4

File tree

18 files changed

+2708
-1478
lines changed

18 files changed

+2708
-1478
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ server {
156156
index index.html index.htm;
157157
try_files $uri $uri/ /index.html; # 防止页面刷新404
158158
}
159+
160+
location /static/avatar/ {
161+
proxy_pass http://fastapi:8000/static/avatar/;
162+
}
159163

160164
location /api {
161165
client_max_body_size 5m;

frontend/README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,34 @@
66
npm install
77
npm run dev
88
npm run build
9-
```
9+
```
10+
11+
### 关于自定义组件的样式问题
12+
13+
- 方案一: 使用 `:deep()` 深度选择器包一下, <font color="red">缺点: 会导致样式全局污染</font>
14+
15+
```css
16+
:deep(.el-table__header) {
17+
background-color: #f5f5f5;
18+
}
19+
```
20+
21+
- 方案二: 使用 `less/scss` 的模块化, <font color="red">缺点: 要分离文件</font>
22+
23+
```css
24+
.dot {
25+
width: 10px;
26+
height: 10px;
27+
background-color: red;
28+
}
29+
```
30+
31+
```vue
32+
<script setup lang="tsx">
33+
import styles from "./index.module.less";
34+
</script>
35+
36+
<template>
37+
<div class="{styles.dot}"></div>
38+
</template>
39+
```

frontend/auto-imports.d.ts

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

frontend/components.d.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/* eslint-disable */
2+
/* prettier-ignore */
3+
// @ts-nocheck
4+
// Generated by unplugin-vue-components
5+
// Read more: https://github.com/vuejs/core/pull/3399
6+
import '@vue/runtime-core'
7+
8+
export {}
9+
10+
declare module '@vue/runtime-core' {
11+
export interface GlobalComponents {
12+
ElAside: typeof import('element-plus/es')['ElAside']
13+
ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer']
14+
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
15+
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
16+
ElButton: typeof import('element-plus/es')['ElButton']
17+
ElCard: typeof import('element-plus/es')['ElCard']
18+
ElContainer: typeof import('element-plus/es')['ElContainer']
19+
ElCountdown: typeof import('element-plus/es')['ElCountdown']
20+
ElDropdown: typeof import('element-plus/es')['ElDropdown']
21+
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
22+
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
23+
ElForm: typeof import('element-plus/es')['ElForm']
24+
ElFormItem: typeof import('element-plus/es')['ElFormItem']
25+
ElHeader: typeof import('element-plus/es')['ElHeader']
26+
ElIcon: typeof import('element-plus/es')['ElIcon']
27+
ElImage: typeof import('element-plus/es')['ElImage']
28+
ElInput: typeof import('element-plus/es')['ElInput']
29+
ElMain: typeof import('element-plus/es')['ElMain']
30+
ElMenu: typeof import('element-plus/es')['ElMenu']
31+
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
32+
ElPagination: typeof import('element-plus/es')['ElPagination']
33+
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
34+
ElTable: typeof import('element-plus/es')['ElTable']
35+
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
36+
ElTableV2: typeof import('element-plus/es')['ElTableV2']
37+
ElTag: typeof import('element-plus/es')['ElTag']
38+
ElTooltip: typeof import('element-plus/es')['ElTooltip']
39+
ElUpload: typeof import('element-plus/es')['ElUpload']
40+
MyTable: typeof import('./src/components/MyTable.vue')['default']
41+
MyTableV2: typeof import('./src/components/MyTableV2.vue')['default']
42+
MyUpload: typeof import('./src/components/MyUpload.vue')['default']
43+
RouterLink: typeof import('vue-router')['RouterLink']
44+
RouterView: typeof import('vue-router')['RouterView']
45+
}
46+
}

frontend/env.d.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/// <reference types="vite/client" />
22

3+
// 防止 App.vue 报错
4+
declare module "*.vue" {
5+
import { defineComponent } from "vue";
6+
const Component: ReturnType<typeof defineComponent>;
7+
export default Component;
8+
}
9+
310
// 防止 ElementPlus 国际化报红
411
declare module "element-plus/dist/locale/zh-cn.mjs";
5-
6-
declare module 'echarts' {
7-
const echarts: any
8-
export default echarts
9-
}

0 commit comments

Comments
 (0)