zhangxing 3 年 前
コミット
71ba9e4ac1
共有2 個のファイルを変更した15 個の追加10 個の削除を含む
  1. 1 1
      .env.production
  2. 14 9
      README.md

+ 1 - 1
.env.production

@@ -1,3 +1,3 @@
 ENV = production,
 VITE_PROJECT_NAME = 朱雀游戏中心
-#VITE_API_HOST = http://gm.nkfzs.com/api/web
+VITE_API_HOST = http://gm.nkfzs.com/api/web

+ 14 - 9
README.md

@@ -1,23 +1,27 @@
 # Vue 3 + TypeScript + Vite
 
-## js文件下载
+### js文件下载
 https://blog.csdn.net/weixin_41217541/article/details/109893272?spm=1001.2101.3001.6650.5&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-5-109893272-blog-112007458.pc_relevant_aa&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-5-109893272-blog-112007458.pc_relevant_aa&utm_relevant_index=10
     
 
-## js 下载
+### js 下载
 https://blog.csdn.net/weixin_43299180/article/details/112007458
 
 
 ## 只刷新一次页面
-if (location.href.indexOf("#reloaded") === -1) {
+`if (location.href.indexOf("#reloaded") === -1) {
     location.href = location.href + "#reloaded";
     location.reload();
-}
+}`
 
 ## vite + vue3 低版本浏览器兼容配置
-1. 安装兼容插件 yarn add @vitejs/plugin-legacy
+1. 安装兼容插件 
+`
+yarn add @vitejs/plugin-legacy
+`
 2. vite.config.ts 中引入
-    import legacy from '@vitejs/plugin-legacy'
+`
+import legacy from '@vitejs/plugin-legacy'
     plugins:[
         legacy({
       targets: ['chrome 50', 'ie >= 11'],       //兼容最低版本号50(UC浏览器55)
@@ -46,8 +50,9 @@ if (location.href.indexOf("#reloaded") === -1) {
       modernPolyfills: ['es.string.replace-all']
     })
     ]
-
+`
 
 ## vite打包时会报错 
-terser not found. Since Vite v3, terser has become an optional dependency. You need to install it. 
-## 解决办法:yarn add terser --legacy-peer-deps 再重新打包
+`terser not found. Since Vite v3, terser has become an optional dependency. You need to install it.`
+## 解决办法:
+`yarn add terser --legacy-peer-deps 再重新打包`