Skip to content

Commit d16c906

Browse files
authored
docs: mention that vuex requires promise (#1033)
* docs: mention that vuex requires promise * docs: add comma before "such as"
1 parent 432487b commit d16c906

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/en/installation.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,31 @@ Vue.use(Vuex)
3838

3939
You don't need to do this when using global script tags.
4040

41+
### Promise
42+
43+
Vuex requires [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises). If your supporting browsers do not implement Promise (e.g. IE), you can use a polyfill library, such as [es6-promise](https://github.com/stefanpenner/es6-promise).
44+
45+
You can include it via CDN:
46+
47+
``` html
48+
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script>
49+
```
50+
51+
Then `window.Promise` will be available automatically.
52+
53+
If you prefer using a package manager such as NPM or Yarn, install it with the following commands:
54+
55+
``` bash
56+
npm install es6-promise --save # NPM
57+
yarn add es6-promise # Yarn
58+
```
59+
60+
Furthermore, add the below line into anywhere in your code before using Vuex:
61+
62+
``` js
63+
import 'es6-promise/auto'
64+
```
65+
4166
### Dev Build
4267

4368
You will have to clone directly from GitHub and build `vuex` yourself if

0 commit comments

Comments
 (0)