File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -552,7 +552,8 @@ CompilerProto.compileElement = function (node, root) {
552552 // non directive attribute, check interpolation tags
553553 exp = TextParser . parseAttr ( attr . value )
554554 if ( exp ) {
555- directive = this . parseDirective ( 'attr' , attr . name + ':' + exp , node )
555+ directive = this . parseDirective ( 'attr' , exp , node )
556+ directive . arg = attr . name
556557 if ( params && params . indexOf ( attr . name ) > - 1 ) {
557558 // a param attribute... we should use the parent binding
558559 // to avoid circular updates like size={{size}}
Original file line number Diff line number Diff line change @@ -285,4 +285,18 @@ describe('Misc Features', function () {
285285
286286 } )
287287
288+ describe ( 'attribute names with colons' , function ( ) {
289+
290+ it ( 'should be parsed properly' , function ( ) {
291+ var t = new Vue ( {
292+ template : '<use xlink:href="{{icon}}"></use>' ,
293+ data : {
294+ icon : 'test'
295+ }
296+ } )
297+ assert . equal ( t . $el . firstChild . getAttribute ( 'xlink:href' ) , 'test' )
298+ } )
299+
300+ } )
301+
288302} )
You can’t perform that action at this time.
0 commit comments