Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
620ae92b0025
Commit
a7a751ae
authored
Mar 01, 2018
by
Filipa Lacerda
Browse files
Merge branch 'winh-fix-vuex-docs' into 'master'
Small fixes in Vuex docs See merge request gitlab-org/gitlab-ce!17471
parents
2aba3bbbb766
9b74b728f77f
Changes
1
Show whitespace changes
Inline
Side-by-side
doc/development/fe_guide/vue.md
View file @
620ae92b
...
...
@@ -508,7 +508,7 @@ import Vue from 'vue';
import
Vuex
from
'
vuex
'
;
import
*
as
actions
from
'
./actions
'
;
import
*
as
getters
from
'
./getters
'
;
import
*
as
mutations
from
'
./mutations
'
;
import
mutations
from
'
./mutations
'
;
Vue
.
use
(
Vuex
);
...
...
@@ -527,7 +527,7 @@ _Note:_ If the state of the application is too complex, an individual file for t
An action commits a mutatation. In this file, we will write the actions that will call the respective mutation:
```
javascript
import
*
as
types
from
'
./mutation
-
types
'
import
*
as
types
from
'
./mutation
_
types
'
;
export
const
addUser
=
({
commit
},
user
)
=>
{
commit
(
types
.
ADD_USER
,
user
);
...
...
@@ -577,7 +577,8 @@ import { mapGetters } from 'vuex';
The only way to actually change state in a Vuex store is by committing a mutation.
```
javascript
import
*
as
types
from
'
./mutation-types
'
import
*
as
types
from
'
./mutation_types
'
;
export
default
{
[
types
.
ADD_USER
](
state
,
user
)
{
state
.
users
.
push
(
user
);
...
...
@@ -686,4 +687,3 @@ describe('component', () => {
[
vuex-testing
]:
https://vuex.vuejs.org/en/testing.html
[
axios
]:
https://github.com/axios/axios
[
axios-interceptors
]:
https://github.com/axios/axios#interceptors
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