Feature flag __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ is not explicitly defined...
解决控制台黄色警告Feature flag __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ is not explicitly defined……
文章共206字 · 阅读需要大约1分钟
一键AI生成摘要,助你高效阅读
问答
·
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.
不知道什么时候控制台就出现了一个黄色警告,刚开始没在意,觉得我代码写完应该就没了,结果一直在……有点点强迫症,就搜了一下解决办法[😁],但是那位博主加的有点多,我就加了几句也解决了,就没管其他的了。(啰嗦如我)
在vite.config.ts里面加这一段:
import { defineConfig } from "vite";
export default defineConfig({
define: {
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "true",
},
});
OK,控制台干净了。
参考博文:
更多推荐
已为社区贡献3条内容
所有评论(0)