@@ -49,7 +49,7 @@ function Compiler (vm, options) {
4949 log ( '\nnew VM instance:' , el . tagName , '\n' )
5050
5151 // set compiler properties
52- compiler . vm = vm
52+ compiler . vm = el . vue_vm = vm
5353 compiler . bindings = makeHash ( )
5454 compiler . dirs = [ ]
5555 compiler . deferred = [ ]
@@ -132,7 +132,9 @@ function Compiler (vm, options) {
132132 compiler . init = false
133133
134134 // post compile / ready hook
135- compiler . execHook ( 'ready' )
135+ if ( ! compiler . delayReady ) {
136+ compiler . execHook ( 'ready' )
137+ }
136138}
137139
138140var CompilerProto = Compiler . prototype
@@ -304,7 +306,7 @@ CompilerProto.compile = function (node, root) {
304306
305307 // special attributes to check
306308 var repeatExp ,
307- withKey ,
309+ withExp ,
308310 partialId ,
309311 directive ,
310312 componentId = utils . attr ( node , 'component' ) || tagName . toLowerCase ( ) ,
@@ -332,13 +334,19 @@ CompilerProto.compile = function (node, root) {
332334 }
333335
334336 // v-with has 2nd highest priority
335- } else if ( root !== true && ( ( withKey = utils . attr ( node , 'with' ) ) || componentCtor ) ) {
336-
337- directive = Directive . parse ( 'with' , withKey || '' , compiler , node )
338- if ( directive ) {
339- directive . Ctor = componentCtor
340- compiler . deferred . push ( directive )
341- }
337+ } else if ( root !== true && ( ( withExp = utils . attr ( node , 'with' ) ) || componentCtor ) ) {
338+
339+ withExp = Directive . split ( withExp || '' )
340+ withExp . forEach ( function ( exp , i ) {
341+ var directive = Directive . parse ( 'with' , exp , compiler , node )
342+ if ( directive ) {
343+ directive . Ctor = componentCtor
344+ // notify the directive that this is the
345+ // last expression in the group
346+ directive . last = i === withExp . length - 1
347+ compiler . deferred . push ( directive )
348+ }
349+ } )
342350
343351 } else {
344352
@@ -801,6 +809,7 @@ CompilerProto.destroy = function () {
801809 } else {
802810 vm . $remove ( )
803811 }
812+ el . vue_vm = null
804813
805814 this . destroyed = true
806815 // emit destroy hook
0 commit comments