Skip to content

Commit e2e5caf

Browse files
committed
modify: Added todo-item state.
1 parent 1713596 commit e2e5caf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/store/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const createStore = () => {
1111
state: () => ({
1212
counter: 0,
1313
isUser: false,
14+
todoItem: [],
1415
}),
1516
mutations: {
1617
increment(state) {
@@ -19,6 +20,14 @@ const createStore = () => {
1920
setUser(state, payload) {
2021
state.isUser = payload.bool;
2122
console.log('mutations');
23+
},
24+
setTodoItem(state, payload) {
25+
const data = {
26+
id: payload.id,
27+
hexCode: payload.hexCode,
28+
svgPath: payload.svgPath,
29+
}
30+
state.todoItem.push(data);
2231
}
2332
},
2433
actions: {

0 commit comments

Comments
 (0)