From f3423943e6f6703e41e57685c9589b7fc8ee1911 Mon Sep 17 00:00:00 2001 From: juetan Date: Fri, 3 Nov 2023 22:49:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 ++-- src/components/table/table.tsx | 1 + vite.config.ts | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) 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, }, }, },