File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 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
77
88export class Store {
99 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+
1017 if ( process . env . NODE_ENV !== 'production' ) {
1118 assert ( Vue , `must call Vue.use(Vuex) before creating a store instance.` )
1219 assert ( typeof Promise !== 'undefined' , `vuex requires a Promise polyfill in this browser.` )
@@ -463,8 +470,3 @@ export function install (_Vue) {
463470 Vue = _Vue
464471 applyMixin ( Vue )
465472}
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