Просмотр исходного кода

fix problematic use of 'deprecated' in warnings (#4043)

Chris Fritz 9 лет назад
Родитель
Сommit
84918577d2

+ 1 - 1
src/compiler/parser/index.js

@@ -399,7 +399,7 @@ function processAttrs (el) {
         if (expression) {
           warn(
             `${name}="${value}": ` +
-            'Interpolation inside attributes has been deprecated. ' +
+            'Interpolation inside attributes has been removed. ' +
             'Use v-bind or the colon shorthand instead. For example, ' +
             'instead of <div id="{{ val }}">, use <div :id="val">.'
           )

+ 3 - 2
src/platforms/web/compiler/modules/class.js

@@ -15,8 +15,9 @@ function transformNode (el: ASTElement, options: CompilerOptions) {
     if (expression) {
       warn(
         `class="${staticClass}": ` +
-        'Interpolation inside attributes has been deprecated. ' +
-        'Use v-bind or the colon shorthand instead.'
+        'Interpolation inside attributes has been removed. ' +
+        'Use v-bind or the colon shorthand instead. For example, ' +
+        'instead of <div class="{{ val }}">, use <div :class="val">.'
       )
     }
   }

+ 2 - 2
test/unit/modules/compiler/parser.spec.js

@@ -256,7 +256,7 @@ describe('parser', () => {
     expect(ast2.classBinding).toBe('class1')
     // interpolation warning
     parse('<p class="{{error}}">hello world</p>', baseOptions)
-    expect('Interpolation inside attributes has been deprecated').toHaveBeenWarned()
+    expect('Interpolation inside attributes has been removed').toHaveBeenWarned()
   })
 
   it('style binding', () => {
@@ -318,7 +318,7 @@ describe('parser', () => {
     expect(ast1.attrs[2].value).toBe('"hello world"')
     // interpolation warning
     parse('<input type="text" name="field1" value="{{msg}}">', baseOptions)
-    expect('Interpolation inside attributes has been deprecated').toHaveBeenWarned()
+    expect('Interpolation inside attributes has been removed').toHaveBeenWarned()
   })
 
   if (!isIE) {