English 中文(简体)
特征标志__VUE_PROD_HYDRATION_MISMATCH_DETAILS__没有明确界定。 我在什么地方界定了它?
原标题:Feature flag __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ is not explicitly defined. Where do I define it?

自我提升到3.4.4版后,我现在在我的浏览器的ole子里收到以下警告:

特征旗帜VUE_PROD_HYDRATION_MISMATCH_DETAILS没有明确定义。 你们正在管理着Vue的es子-b子建设,预计这些集邮的标志将在全球范围内通过dler子会注入,以便在生产泡沫中更好地植树。

因此,我读到,它带有一些新旗帜。

EDIT:

在我的项目中,Im使用卷宗。 是否应当增加国旗? 目前,它希望:

const { defineConfig } = require( @vue/cli-service )
module.exports = defineConfig({
  transpileDependencies: true
})

My question: "Where do I set this flag"? I find a lot of info about that I should define this flag but no info on "where" I should define it...

最佳回答

If you are using the no longer maintained @vue/cli-service with webpack, it is caused by the fact that the tool does not define the default for this feature flag. It does so for the other two bundler feature flags, and while I created a PR to add this default (as I just hit this myself - https://github.com/vuejs/vue-cli/pull/7443), I do not expect it to get merged and released as the latest release is from July 2022.

So, you should define it yourself in the webpack configuration using the define plugin.

由于对<代码>vue.config.js的使用提出疑问,你可以确定如下:

const { defineConfig } = require( @vue/cli-service )
const webpack = require( webpack );

module.exports = defineConfig({
  configureWebpack: {
    plugins: [
      new webpack.DefinePlugin({
        // Vue CLI is in maintenance mode, and probably won t merge my PR to fix this in their tooling
        // https://github.com/vuejs/vue-cli/pull/7443
        __VUE_PROD_HYDRATION_MISMATCH_DETAILS__:  false ,
      })
    ],
  },
});

https://cli.vuejs.org/config/#configureweb Pack

问题回答

对我来说,首先需要安装网络包

npm install webpack --save-dev

安装后,编辑与文件

const { defineConfig } = require( @vue/cli-service )
const webpack = require( webpack );

module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: {
    plugins: [
      new webpack.DefinePlugin({
         __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ : JSON.stringify(false),  
// Replace with true if detailed mismatch info is needed
         __VUE_OPTIONS_API__ : JSON.stringify(true),
        __VUE_PROD_HYDRATION_MISMATCH_DETAILS__:  false ,
      })
    ],
  },
})




相关问题
Nuxt 3 useRoute import cannot find

I am using latest nuxt version and when I tried to use the useRoute method is triggers a "Cannot Find name useRoute" but it works so I would like to know what could I be missing My package ...

Vue array dependent select not display data

I have dependent selection like this. Selection image when i console log, they have data but not render data in selection data This is what i ve tried. for Product selection has default selected value ...

How to inject Bearer Token in Axios boot file

Quasar has a different setup using boot files and my current axios.ts looks liek this: import { boot } from quasar/wrappers ; import axios, { AxiosInstance } from axios ; declare module @vue/...

Vue router and Vite Base url conflict

I use Vue Router to develop my single page application and use Vite to package my project. I want to deploy all static files (such as index.js and index.css) under another CDN domain name (cdn.example....

Vue.js change class on mounted

I have a button element with a .hover property and I need the hover animation to also happen as soon as the page is mounted. How can I attribute a class to a button on the mounted function and then ...

Laravel +Vuejs CORS issue

I am facing a dilemma wit the CORS issue. I have application that is configured as follow: API: https://abc.mydomain.com (laravel) front end: https://subdomain.mydomain.com(VueJS) Both applications ...

热门标签