File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -621,7 +621,7 @@ function compileDirectives (attrs, options) {
621621 return attr . name === ':class' || attr . name === 'v-bind:class'
622622 } ) ) {
623623 _ . warn (
624- name + ' ="' + rawValue + '": Do not mix mustache interpolation ' +
624+ 'class ="' + rawValue + '": Do not mix mustache interpolation ' +
625625 'and v-bind for "class" on the same element. Use one or the other.'
626626 )
627627 }
Original file line number Diff line number Diff line change @@ -517,6 +517,17 @@ if (_.inBrowser) {
517517 expect ( hasWarned ( _ , 'attribute interpolation is not allowed in Vue.js directives' ) ) . toBe ( true )
518518 } )
519519
520+ it ( 'attribute interpolation: warn mixed usage with v-bind' , function ( ) {
521+ new Vue ( {
522+ el : el ,
523+ template : '<div class="{{a}}" :class="bcd"></div>' ,
524+ data : {
525+ a : 'hi'
526+ }
527+ } )
528+ expect ( hasWarned ( _ , 'Do not mix mustache interpolation and v-bind' ) ) . toBe ( true )
529+ } )
530+
520531 it ( 'warn directives on fragment instances' , function ( ) {
521532 new Vue ( {
522533 el : el ,
You can’t perform that action at this time.
0 commit comments