Skip to content

Commit 8491857

Browse files
chrisvfritzyyx990803
authored andcommitted
fix problematic use of 'deprecated' in warnings (#4043)
1 parent 2ac581b commit 8491857

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/compiler/parser/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ function processAttrs (el) {
399399
if (expression) {
400400
warn(
401401
`${name}="${value}": ` +
402-
'Interpolation inside attributes has been deprecated. ' +
402+
'Interpolation inside attributes has been removed. ' +
403403
'Use v-bind or the colon shorthand instead. For example, ' +
404404
'instead of <div id="{{ val }}">, use <div :id="val">.'
405405
)

src/platforms/web/compiler/modules/class.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ function transformNode (el: ASTElement, options: CompilerOptions) {
1515
if (expression) {
1616
warn(
1717
`class="${staticClass}": ` +
18-
'Interpolation inside attributes has been deprecated. ' +
19-
'Use v-bind or the colon shorthand instead.'
18+
'Interpolation inside attributes has been removed. ' +
19+
'Use v-bind or the colon shorthand instead. For example, ' +
20+
'instead of <div class="{{ val }}">, use <div :class="val">.'
2021
)
2122
}
2223
}

test/unit/modules/compiler/parser.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ describe('parser', () => {
256256
expect(ast2.classBinding).toBe('class1')
257257
// interpolation warning
258258
parse('<p class="{{error}}">hello world</p>', baseOptions)
259-
expect('Interpolation inside attributes has been deprecated').toHaveBeenWarned()
259+
expect('Interpolation inside attributes has been removed').toHaveBeenWarned()
260260
})
261261

262262
it('style binding', () => {
@@ -318,7 +318,7 @@ describe('parser', () => {
318318
expect(ast1.attrs[2].value).toBe('"hello world"')
319319
// interpolation warning
320320
parse('<input type="text" name="field1" value="{{msg}}">', baseOptions)
321-
expect('Interpolation inside attributes has been deprecated').toHaveBeenWarned()
321+
expect('Interpolation inside attributes has been removed').toHaveBeenWarned()
322322
})
323323

324324
if (!isIE) {

0 commit comments

Comments
 (0)