Browse Source

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

dev
Chris Fritz 8 years ago
committed by Evan You
parent
commit
84918577d2
  1. 2
      src/compiler/parser/index.js
  2. 5
      src/platforms/web/compiler/modules/class.js
  3. 4
      test/unit/modules/compiler/parser.spec.js

2
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">.'
)

5
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">.'
)
}
}

4
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) {

Loading…
Cancel
Save