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
0308932e
Commit
0308932e
authored
Feb 15, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes in Vuex docs
parent
7aa9ec7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
doc/development/fe_guide/vue.md
doc/development/fe_guide/vue.md
+4
-4
No files found.
doc/development/fe_guide/vue.md
View file @
0308932e
...
@@ -508,7 +508,7 @@ import Vue from 'vue';
...
@@ -508,7 +508,7 @@ import Vue from 'vue';
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
*
as
actions
from
'
./actions
'
;
import
*
as
actions
from
'
./actions
'
;
import
*
as
getters
from
'
./getters
'
;
import
*
as
getters
from
'
./getters
'
;
import
*
as
mutations
from
'
./mutations
'
;
import
mutations
from
'
./mutations
'
;
Vue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
...
@@ -527,7 +527,7 @@ _Note:_ If the state of the application is too complex, an individual file for t
...
@@ -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:
An action commits a mutatation. In this file, we will write the actions that will call the respective mutation:
```
javascript
```
javascript
import
*
as
types
from
'
./mutation
-types
'
import
*
as
types
from
'
./mutation
_types
'
;
export
const
addUser
=
({
commit
},
user
)
=>
{
export
const
addUser
=
({
commit
},
user
)
=>
{
commit
(
types
.
ADD_USER
,
user
);
commit
(
types
.
ADD_USER
,
user
);
...
@@ -577,7 +577,8 @@ import { mapGetters } from 'vuex';
...
@@ -577,7 +577,8 @@ import { mapGetters } from 'vuex';
The only way to actually change state in a Vuex store is by committing a mutation.
The only way to actually change state in a Vuex store is by committing a mutation.
```
javascript
```
javascript
import
*
as
types
from
'
./mutation-types
'
import
*
as
types
from
'
./mutation_types
'
;
export
default
{
export
default
{
[
types
.
ADD_USER
](
state
,
user
)
{
[
types
.
ADD_USER
](
state
,
user
)
{
state
.
users
.
push
(
user
);
state
.
users
.
push
(
user
);
...
@@ -686,4 +687,3 @@ describe('component', () => {
...
@@ -686,4 +687,3 @@ describe('component', () => {
[
vuex-testing
]:
https://vuex.vuejs.org/en/testing.html
[
vuex-testing
]:
https://vuex.vuejs.org/en/testing.html
[
axios
]:
https://github.com/axios/axios
[
axios
]:
https://github.com/axios/axios
[
axios-interceptors
]:
https://github.com/axios/axios#interceptors
[
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