Intensive reading of the Vue official document series 🎉


The following are the configuration items for vue.config.

config.silent

Cancel Vue log and warning output.

Vue.config.silent = false;
Copy the code

config.optionMergeStrategies

Custom merge policy for component options. Main function and:

  • Vue.extend({... })
  • The Vuemixin
Vue.config.optionMergeStrategies.custom_option = function (parent, value, vm) {
   /* * parent parent instance * value Value of the current option * VM instance context */
    return value + 1;
}
Copy the code

config.devtools

Configure whether to allow vue-DevTools to check code. The default is true for the development version and false for the production version

config.errorHandler

The Vue runtime error message capture handler can be used in conjunction with the error tracing service Sentry.

config.warnHandler

Vue runtime warning message capture handler.

Development version only.

config.ignoredElements

To ignore the warning generated by Unknown custom element. Possible causes include:

  1. Custom tag elements based on the Web Components APIs are used.
  2. Forgot to register the component.
  3. Component element name misspelled.

config.keyCodes

Customize the alias for the keycode.

Vue.config.keyCodes = {
    'media-play-pause': 179
};
Copy the code

Note: Key names are supported only in Kebab-case and not in camelCase or PascalCase

config.performance

Works in development mode and on browsers that support the Performance. Mark API. The Performance tools of Vue-devTools enable performance tracking for component initialization, compilation, rendering, and patching.

config.productTip

Prompts to control the development environment.

You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html
Copy the code