Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
00ba8248
Commit
00ba8248
authored
Dec 11, 2018
by
Sylhare
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spaces before code snippets
parent
56936cd8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
doc/development/fe_guide/vuex.md
doc/development/fe_guide/vuex.md
+5
-1
No files found.
doc/development/fe_guide/vuex.md
View file @
00ba8248
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment