From 4165ebe94e92af85b093abe264eb404c6a5181e7 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 22 十一月 2024 10:48:08 +0800 Subject: [PATCH] 答题器收藏功能优化 --- vite.config.ts | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 1b47c8f..ecb6c57 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,16 +2,25 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx'; import electron from 'vite-plugin-electron' // https://vitejs.dev/config/ export default defineConfig({ + base:"./", plugins: [ - vue(), - electron({ - // 閰嶇疆 Electron 鍏ュ彛鏂囦欢 - entry: 'electron-commonJS/main.js' + vueJsx(), + vue({ + template: { + compilerOptions: { + isCustomElement: (tag) => tag.includes('math-field') + } + } }), + // electron({ + // // 閰嶇疆 Electron 鍏ュ彛鏂囦欢 + // entry: 'electron-commonJS/main.js' + // }), ], resolve: { alias: { @@ -22,7 +31,11 @@ host: true, port: 8005, strictPort: true, - hmr: true + cors: true, // 鍏佽璺ㄥ煙 + hmr: true, + headers: { + "access-control-allow-origin": "*", // 鍏佽璺ㄥ煙璁块棶瀛愬簲鐢ㄩ〉闈� + }, }, define: { 'process.env': process.env @@ -34,5 +47,5 @@ additionalData: '@import "./src/assets/style/global.less";' } } - } + }, }) -- Gitblit v1.9.1