Updates how to export the state object
This commit is contained in:
parent
253bad8ceb
commit
cbe69e4324
|
@ -52,7 +52,7 @@ The first thing you should do before writing any code is to design the state.
|
||||||
Often we need to provide data from haml to our Vue application. Let's store it in the state for better access.
|
Often we need to provide data from haml to our Vue application. Let's store it in the state for better access.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
export default {
|
export default () => ({
|
||||||
endpoint: null,
|
endpoint: null,
|
||||||
|
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
|
@ -62,7 +62,7 @@ Often we need to provide data from haml to our Vue application. Let's store it i
|
||||||
errorAddingUser: false,
|
errorAddingUser: false,
|
||||||
|
|
||||||
users: [],
|
users: [],
|
||||||
};
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Access `state` properties
|
#### Access `state` properties
|
||||||
|
|
Loading…
Reference in New Issue