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) {
161
161
}
162
162
// include computed fields
163
163
if ( ! path ) {
164
- for ( var key in this . $options . computed ) {
164
+ var key
165
+ for ( key in this . $options . computed ) {
165
166
data [ key ] = clean ( this [ key ] )
166
167
}
168
+ if ( this . _props ) {
169
+ for ( key in this . _props ) {
170
+ data [ key ] = clean ( this [ key ] )
171
+ }
172
+ }
167
173
}
168
174
console . log ( data )
169
175
}
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ var nextTick = _.nextTick
5
5
describe ( 'Data API' , function ( ) {
6
6
var vm
7
7
beforeEach ( function ( ) {
8
+ var el = document . createElement ( 'div' )
9
+ el . setAttribute ( 'prop' , 'hi' )
8
10
vm = new Vue ( {
11
+ el : el ,
12
+ props : [ 'prop' ] ,
9
13
data : {
10
14
a : 1 ,
11
15
b : {
@@ -150,6 +154,7 @@ describe('Data API', function () {
150
154
expect ( val . a ) . toBe ( 1 )
151
155
expect ( val . b . c ) . toBe ( 2 )
152
156
expect ( val . d ) . toBe ( 2 )
157
+ expect ( val . prop ) . toBe ( 'hi' )
153
158
spy ( )
154
159
}
155
160
vm . $log ( )
You can’t perform that action at this time.
0 commit comments