File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -178,10 +178,13 @@ module.exports = {
178178 build : function ( data , index , isObject ) {
179179
180180 // wrap non-object values
181- if ( ! isObject || this . arg ) {
182- var raw = data
181+ var raw , alias ,
182+ wrap = ! isObject || this . arg
183+ if ( wrap ) {
184+ raw = data
185+ alias = this . arg || '$value'
183186 data = { $index : index }
184- data [ this . arg || '$value' ] = raw
187+ data [ alias ] = raw
185188 }
186189
187190 var el = this . el . cloneNode ( true ) ,
@@ -199,14 +202,14 @@ module.exports = {
199202 utils . defProtected ( data , this . identifier , true )
200203 vm . $index = index
201204
202- if ( ! isObject || this . arg ) {
205+ if ( wrap ) {
203206 var self = this ,
204207 sync = function ( val ) {
205208 self . lock = true
206209 self . collection . $set ( vm . $index , val )
207210 self . lock = false
208211 }
209- vm . $compiler . observer . on ( 'change:' + ( this . arg || '$value' ) , sync )
212+ vm . $compiler . observer . on ( 'change:' + alias , sync )
210213 }
211214
212215 return vm
You can’t perform that action at this time.
0 commit comments