diff --git a/.env b/.env index 8de803f..25e9cd6 100644 --- a/.env +++ b/.env @@ -6,7 +6,7 @@ VITE_TITLE = 绝弹项目管理 # 网站副标题 VITE_SUBTITLE = 快速开发web应用的模板工具 # 接口前缀 说明:参见 axios 的 baseURL -VITE_API = http://127.0.0.1:3030/ +VITE_API = / # ===================================================================================== # 开发设置 @@ -16,7 +16,7 @@ VITE_HOST = 0.0.0.0 # 端口 VITE_PORT = 3020 # 代理地址 -VITE_PROXY = /api +VITE_PROXY = http://127.0.0.1:3030/ # API文档 说明:需返回符合 OPENAPI 规范的json内容 VITE_OPENAPI = http://127.0.0.1:3030/openapi.json diff --git a/src/components/table/table.tsx b/src/components/table/table.tsx index 89d8221..8b6d554 100644 --- a/src/components/table/table.tsx +++ b/src/components/table/table.tsx @@ -194,6 +194,7 @@ export const Table = defineComponent({ > {{ empty: () => , + ...this.$slots, }} diff --git a/vite.config.ts b/vite.config.ts index 8ae5fcf..8861bd5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,7 @@ import Vue from "@vitejs/plugin-vue"; import VueJsx from "@vitejs/plugin-vue-jsx"; import { resolve } from "path"; +import { visualizer } from "rollup-plugin-visualizer"; import { presetIcons, presetUno } from "unocss"; import Unocss from "unocss/vite"; import AutoImport from "unplugin-auto-import/vite"; @@ -12,7 +13,6 @@ import { arcoToUnoColor } from "./scripts/vite/color"; import iconFile from "./scripts/vite/file.json"; import iconFmt from "./scripts/vite/fmt.json"; import plugin from "./scripts/vite/plugin"; -import { visualizer } from "rollup-plugin-visualizer"; /** * vite 配置 @@ -125,8 +125,11 @@ export default defineConfig(({ mode }) => { host, port, proxy: { + "/api": { + target: env.VITE_PROXY, + }, "/upload": { - target: "http://127.0.0.1:3030", + target: env.VITE_PROXY, }, }, },