File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ let Vue // bind on install
7
7
8
8
export class Store {
9
9
constructor ( options = { } ) {
10
+ // Auto install if it is not done yet and `window` has `Vue`.
11
+ // To allow users to avoid auto-installation in some cases,
12
+ // this code should be placed here. See #731
13
+ if ( ! Vue && typeof window !== 'undefined' && window . Vue ) {
14
+ install ( window . Vue )
15
+ }
16
+
10
17
if ( process . env . NODE_ENV !== 'production' ) {
11
18
assert ( Vue , `must call Vue.use(Vuex) before creating a store instance.` )
12
19
assert ( typeof Promise !== 'undefined' , `vuex requires a Promise polyfill in this browser.` )
@@ -463,8 +470,3 @@ export function install (_Vue) {
463
470
Vue = _Vue
464
471
applyMixin ( Vue )
465
472
}
466
-
467
- // auto install in dist mode
468
- if ( typeof window !== 'undefined' && window . Vue ) {
469
- install ( window . Vue )
470
- }
You can’t perform that action at this time.
0 commit comments