Prechádzať zdrojové kódy

deprecate the interpolate config

Evan You 10 rokov pred
rodič
commit
48a191ee71
2 zmenil súbory, kde vykonal 14 pridanie a 1 odobranie
  1. 5 0
      src/compiler/compile.js
  2. 9 1
      src/deprecations.js

+ 5 - 0
src/compiler/compile.js

@@ -238,6 +238,11 @@ exports.compileRoot = function (el, options) {
  */
 
 function compileNode (node, options) {
+  /* istanbul ignore if */
+  if (process.env.NODE_ENV !== 'production' && !config.interpolate) {
+    _.deprecation.INTERPOLATE()
+  }
+
   var type = node.nodeType
   if (type === 1 && node.tagName !== 'SCRIPT') {
     return compileElement(node, options)

+ 9 - 1
src/deprecations.js

@@ -33,7 +33,7 @@ if (process.env.NODE_ENV !== 'production') {
     STRICT_MODE: function (type, id) {
       warn(
         'Falling through to parent when resolving ' + type + ' with id "' + id +
-        '". Strict mode will default to `true` in 1.0.0. ' +
+        '". Strict mode will be the default in 1.0.0. ' +
         'See https://github.com/yyx990803/vue/issues/1170 for details.'
       )
     },
@@ -201,6 +201,14 @@ if (process.env.NODE_ENV !== 'production') {
         'Use v-for to render the options. See https://github.com/yyx990803/vue/issues/1229 ' +
         'for more details.'
       )
+    },
+
+    INTERPOLATE: function () {
+      /* istanbul ignore next */
+      warn(
+        'The global "interpolate" config will be deprecated in 1.0.0. Use "v-pre" ' +
+        'on elements that should be skipped by the template compiler.'
+      )
     }
 
   }