From ac5941cd73f79e29d95dcda55695407a1a50c65c Mon Sep 17 00:00:00 2001 From: popWheat <49830650+j10ccc@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:15:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(dev):=20=E5=BC=80=E5=8F=91=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E6=B7=BB=E5=8A=A0=E8=99=9A=E6=8B=9F=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=20(#3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- src/main.ts | 8 ++++++++ yarn.lock | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f90061..0ac9e89 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "@vicons/fluent": "^0.11.0", "@vitejs/plugin-vue": "^1.9.3", "typescript": "^4.4.3", + "vconsole": "^3.15.1", "vite": "^2.6.4", "vue-tsc": "^0.3.0" } -} +} \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index afb2830..4328319 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,6 +3,7 @@ import 'vfonts/Lato.css' import { createApp } from 'vue' import { createRouter, createWebHistory } from 'vue-router' import App from './App.vue' +import VConsole from 'vconsole' import { routes } from './routes' // 设置前端路由 @@ -14,3 +15,10 @@ const router = createRouter({ const app = createApp(App) app.use(router) app.mount('#app') + +if (import.meta.env.DEV) { + setTimeout(() => { + new VConsole(); + console.warn("DEV 环境下 VConsole 启动") + }) +} diff --git a/yarn.lock b/yarn.lock index b12db26..f4ca440 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17,6 +17,13 @@ resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.17.3.tgz" integrity sha512-7yJPvPV+ESz2IUTPbOL+YkIGyCqOyNIzdguKQuJGnH7bg1WTIifuM21YqokFt/THWh1AkCRn9IgoykTRCBVpzA== +"@babel/runtime@^7.17.2": + version "7.25.7" + resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.25.7.tgz#7ffb53c37a8f247c8c4d335e89cdf16a2e0d0fb6" + integrity sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/types@^7.6.1", "@babel/types@^7.9.6": version "7.17.0" resolved "https://registry.npmmirror.com/@babel/types/-/types-7.17.0.tgz" @@ -382,6 +389,16 @@ constantinople@^4.0.1: "@babel/parser" "^7.6.0" "@babel/types" "^7.6.1" +copy-text-to-clipboard@^3.0.1: + version "3.2.0" + resolved "https://registry.npmmirror.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.0.tgz#0202b2d9bdae30a49a53f898626dcc3b49ad960b" + integrity sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q== + +core-js@^3.11.0: + version "3.38.1" + resolved "https://registry.npmmirror.com/core-js/-/core-js-3.38.1.tgz#aa375b79a286a670388a1a363363d53677c0383e" + integrity sha512-OP35aUorbU3Zvlx7pjsFdu1rGNnD4pgw/CWoYzRY3t2EzoVT7shKHY1dlAy3f41cGIO7ZDPQimhGFTlEYkG/Hw== + css-line-break@^2.1.0: version "2.1.0" resolved "https://registry.npmmirror.com/css-line-break/-/css-line-break-2.1.0.tgz" @@ -762,6 +779,11 @@ magic-string@^0.30.0: dependencies: "@jridgewell/sourcemap-codec" "^1.4.15" +mutation-observer@^1.0.3: + version "1.0.3" + resolved "https://registry.npmmirror.com/mutation-observer/-/mutation-observer-1.0.3.tgz#42e9222b101bca82e5ba9d5a7acf4a14c0f263d0" + integrity sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA== + naive-ui@^2.19.9: version "2.25.2" resolved "https://registry.npmmirror.com/naive-ui/-/naive-ui-2.25.2.tgz" @@ -953,6 +975,11 @@ react-is@^17.0.1: resolved "https://registry.npmmirror.com/react-is/-/react-is-17.0.2.tgz" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + request-light@^0.5.4: version "0.5.7" resolved "https://registry.npmmirror.com/request-light/-/request-light-0.5.7.tgz" @@ -1054,6 +1081,16 @@ utrie@^1.0.2: dependencies: base64-arraybuffer "^1.0.2" +vconsole@^3.15.1: + version "3.15.1" + resolved "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz#569a8ab15f353259527bbcf004f02946b4482cff" + integrity sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g== + dependencies: + "@babel/runtime" "^7.17.2" + copy-text-to-clipboard "^3.0.1" + core-js "^3.11.0" + mutation-observer "^1.0.3" + vdirs@^0.1.4, vdirs@^0.1.7: version "0.1.7" resolved "https://registry.npmmirror.com/vdirs/-/vdirs-0.1.7.tgz"