summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcia Ramos <virtua.creative@gmail.com>2018-12-12 13:05:33 +0000
committerMarcia Ramos <virtua.creative@gmail.com>2018-12-12 13:05:33 +0000
commit85102b59ee2d676f912de58ca77b6f3331305e24 (patch)
tree414795d01064e73a245e5b6ddea8de5d49656397
parent4dfe717848c4541b32cec887a1386fbc88ee0633 (diff)
parent00ba82487d5a959ce4f36f3c2d2599cd027cdd48 (diff)
downloadgitlab-ce-85102b59ee2d676f912de58ca77b6f3331305e24.tar.gz
Merge branch 'patch-35' into 'master'
Docs: Add spaces before code snippets in vuex.md See merge request gitlab-org/gitlab-ce!23737
-rw-r--r--doc/development/fe_guide/vuex.md6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/development/fe_guide/vuex.md b/doc/development/fe_guide/vuex.md
index 0f57835fb87..65963b959f7 100644
--- a/doc/development/fe_guide/vuex.md
+++ b/doc/development/fe_guide/vuex.md
@@ -137,6 +137,7 @@ By following this pattern we guarantee:
#### Dispatching actions
To dispatch an action from a component, use the `mapActions` helper:
+
```javascript
import { mapActions } from 'vuex';
@@ -204,6 +205,7 @@ export const getUsersWithPets = (state, getters) => {
```
To access a getter from a component, use the `mapGetters` helper:
+
```javascript
import { mapGetters } from 'vuex';
@@ -226,6 +228,7 @@ export const ADD_USER = 'ADD_USER';
### How to include the store in your application
The store should be included in the main component of your application:
+
```javascript
// app.vue
import store from 'store'; // it will include the index.js file
@@ -364,7 +367,8 @@ Because we're currently using [`babel-plugin-rewire`](https://github.com/speedsk
`[vuex] actions should be function or object with "handler" function`
To prevent this error from happening, you need to export an empty function as `default`:
-```
+
+```javascript
// getters.js or actions.js
// prevent babel-plugin-rewire from generating an invalid default during karma tests