Use of eval in "../../node_modules/.pnpm/vconsole@3.15.1/node_modules/vconsole/dist/vconsole.min.js" is strongly discouraged as it poses security risks and may cause issues with minification.
报错原因:vconsole里面使用了eval,这被认为是不安全的
解决方法:
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script> <script> // 初始化 vConsole var vConsole = new VConsole(); </script>
或者
if (import.meta.env.DEV) { // 动态导入vconsole import('vconsole').then((module) => { const VConsole = module.default; new VConsole(); }); }
Use of eval in “../../node_modules/.pnpm/vconsole@3.15.1/node_modules/vconsole/dist/vconsole.min.js
于 2025-02-14 16:26:52 首次发布