运行Vue3项目,控制台警告:Feature flag VUE_PROD_HYDRATION_MISMATCH_DETAILS is not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.For more details, see https://link.vuejs.org/feature-flags.
这个警告是因为在 Vue3 的 main.js 文件缺少对指定特性标志的定义。表明你在使用 Vue 的开发版本,并且未定义所需的特性标志。在生产环境中,为了获得更好的树摇优化,Vue 需要特定的特性标志,以减小生成的生产包的大小。
解决方法:
在main.js文件里加入以下代码即可
// 定义特性标志
window.__VUE_PROD_DEVTOOLS__ = false;
window.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ = false;
标签:VUE,Vue,Vue3,控制台,PROD,警告
From: https://www.cnblogs.com/youxl189/p/18259581