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 @@ -161,9 +161,15 @@ export default function (Vue) {
161161 }
162162 // include computed fields
163163 if ( ! path ) {
164- for ( var key in this . $options . computed ) {
164+ var key
165+ for ( key in this . $options . computed ) {
165166 data [ key ] = clean ( this [ key ] )
166167 }
168+ if ( this . _props ) {
169+ for ( key in this . _props ) {
170+ data [ key ] = clean ( this [ key ] )
171+ }
172+ }
167173 }
168174 console . log ( data )
169175 }
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ var nextTick = _.nextTick
55describe ( 'Data API' , function ( ) {
66 var vm
77 beforeEach ( function ( ) {
8+ var el = document . createElement ( 'div' )
9+ el . setAttribute ( 'prop' , 'hi' )
810 vm = new Vue ( {
11+ el : el ,
12+ props : [ 'prop' ] ,
913 data : {
1014 a : 1 ,
1115 b : {
@@ -150,6 +154,7 @@ describe('Data API', function () {
150154 expect ( val . a ) . toBe ( 1 )
151155 expect ( val . b . c ) . toBe ( 2 )
152156 expect ( val . d ) . toBe ( 2 )
157+ expect ( val . prop ) . toBe ( 'hi' )
153158 spy ( )
154159 }
155160 vm . $log ( )
You can’t perform that action at this time.
0 commit comments