File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class Store {
53
53
}
54
54
55
55
get state ( ) {
56
- return this . _vm . state
56
+ return this . _vm . $data . state
57
57
}
58
58
59
59
set state ( v ) {
Original file line number Diff line number Diff line change @@ -173,10 +173,10 @@ describe('Vuex', () => {
173
173
it ( 'getters' , ( ) => {
174
174
const store = new Vuex . Store ( {
175
175
state : {
176
- a : 1
176
+ a : 0
177
177
} ,
178
178
getters : {
179
- hasAny : state => state . a > 1
179
+ state : state => state . a > 0 ? 'hasAny' : 'none'
180
180
} ,
181
181
mutations : {
182
182
[ TEST ] ( state , n ) {
@@ -186,17 +186,17 @@ describe('Vuex', () => {
186
186
actions : {
187
187
check ( { getters } , value ) {
188
188
// check for exposing getters into actions
189
- expect ( getters . hasAny ) . toBe ( value )
189
+ expect ( getters . state ) . toBe ( value )
190
190
}
191
191
}
192
192
} )
193
- expect ( store . getters . hasAny ) . toBe ( false )
194
- store . dispatch ( 'check' , false )
193
+ expect ( store . getters . state ) . toBe ( 'none' )
194
+ store . dispatch ( 'check' , 'none' )
195
195
196
196
store . commit ( TEST , 1 )
197
197
198
- expect ( store . getters . hasAny ) . toBe ( true )
199
- store . dispatch ( 'check' , true )
198
+ expect ( store . getters . state ) . toBe ( 'hasAny' )
199
+ store . dispatch ( 'check' , 'hasAny' )
200
200
} )
201
201
202
202
it ( 'dynamic module registration' , ( ) => {
You can’t perform that action at this time.
0 commit comments