Jelajahi Sumber

expose config._lifecycleHooks for compat (close #5391)

Evan You 9 tahun lalu
induk
melakukan
a150317324
1 mengubah file dengan 12 tambahan dan 1 penghapusan
  1. 12 1
      src/core/config.js

+ 12 - 1
src/core/config.js

@@ -6,6 +6,8 @@ import {
   identity
   identity
 } from 'shared/util'
 } from 'shared/util'
 
 
+import { LIFECYCLE_HOOKS } from 'shared/constants'
+
 export type Config = {
 export type Config = {
   // user
   // user
   optionMergeStrategies: { [key: string]: Function };
   optionMergeStrategies: { [key: string]: Function };
@@ -16,6 +18,7 @@ export type Config = {
   errorHandler: ?(err: Error, vm: Component, info: string) => void;
   errorHandler: ?(err: Error, vm: Component, info: string) => void;
   ignoredElements: Array<string>;
   ignoredElements: Array<string>;
   keyCodes: { [key: string]: number | Array<number> };
   keyCodes: { [key: string]: number | Array<number> };
+
   // platform
   // platform
   isReservedTag: (x?: string) => boolean;
   isReservedTag: (x?: string) => boolean;
   isReservedAttr: (x?: string) => boolean;
   isReservedAttr: (x?: string) => boolean;
@@ -23,6 +26,9 @@ export type Config = {
   isUnknownElement: (x?: string) => boolean;
   isUnknownElement: (x?: string) => boolean;
   getTagNamespace: (x?: string) => string | void;
   getTagNamespace: (x?: string) => string | void;
   mustUseProp: (tag: string, type: ?string, name: string) => boolean;
   mustUseProp: (tag: string, type: ?string, name: string) => boolean;
+
+  // legacy
+  _lifecycleHooks: Array<string>;
 };
 };
 
 
 export default ({
 export default ({
@@ -98,5 +104,10 @@ export default ({
    * Check if an attribute must be bound using property, e.g. value
    * Check if an attribute must be bound using property, e.g. value
    * Platform-dependent.
    * Platform-dependent.
    */
    */
-  mustUseProp: no
+  mustUseProp: no,
+
+  /**
+   * Exposed for legacy reasons
+   */
+  _lifecycleHooks: LIFECYCLE_HOOKS
 }: Config)
 }: Config)