From b74404d4f0868e2c382c12feec80f0d282a26814 Mon Sep 17 00:00:00 2001 From: Kossie Coder Date: Sat, 14 Aug 2021 14:32:44 +1000 Subject: [PATCH] 82 --- db.json | 54 +++++++++++++++++++------------- src/composables/toast.js | 2 +- src/store/modules/toast/index.js | 7 +++-- 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/db.json b/db.json index 37a65c7..10ac1e9 100644 --- a/db.json +++ b/db.json @@ -105,12 +105,6 @@ "body": "asdf", "id": 25 }, - { - "subject": "a", - "completed": false, - "body": "a", - "id": 26 - }, { "subject": "df", "completed": false, @@ -142,64 +136,82 @@ "id": 31 }, { - "subject": "asdf", + "subject": "타입스크립트 공부", "completed": false, "body": "asdf", "id": 32 }, { - "subject": "asdf", + "subject": "라라벨 공부", "completed": false, "body": "asdf", "id": 33 }, { - "subject": "adsf", + "subject": "파이썬 공부", "completed": false, "body": "asdf", "id": 34 }, { - "subject": "adsf", + "subject": "css 공부", "completed": false, "body": "asdf", "id": 35 }, { - "subject": "asd", + "subject": "html 공부", "completed": false, "body": "asdfff", "id": 36 }, { - "subject": "e", - "completed": false, + "subject": "코지 코더 채널 뷰 공부 ㅋㅋㅋ", + "completed": true, "body": "fff", "id": 37 }, { - "subject": "f", - "completed": false, + "subject": "게임하기", + "completed": true, "body": "fa", "id": 38 }, { - "subject": "asdf", - "completed": false, + "subject": "뷰js 공부하기", + "completed": true, "body": "asdffffffdf", "id": 39 }, { - "subject": "asdf", + "subject": "study javascript", + "completed": true, + "body": "asdfffffff", + "id": 40 + }, + { + "subject": "adsf", "completed": false, "body": "asdf", - "id": 40 + "id": 41 + }, + { + "subject": "as", + "completed": false, + "body": "", + "id": 42 }, { "subject": "asdf", "completed": false, - "body": "asdffff", - "id": 41 + "body": "asdf", + "id": 43 + }, + { + "subject": "asdfasdf", + "completed": false, + "body": "dsaf", + "id": 44 } ] } \ No newline at end of file diff --git a/src/composables/toast.js b/src/composables/toast.js index 46433f1..13993b1 100644 --- a/src/composables/toast.js +++ b/src/composables/toast.js @@ -9,7 +9,7 @@ export const useToast = () => { // const showToast = computed(() => store.state.toast.showToast); const triggerToast = (message, type = 'success') => { - store.dispatch('toast/triggerToast', message, type); + store.dispatch('toast/triggerToast', { message, type }); } return { diff --git a/src/store/modules/toast/index.js b/src/store/modules/toast/index.js index 39446b9..32bc256 100644 --- a/src/store/modules/toast/index.js +++ b/src/store/modules/toast/index.js @@ -24,14 +24,15 @@ export default { }, }, actions: { - triggerToast({ commit }, message, type = 'success') { + triggerToast({ commit }, payload) { + // message, type = 'success' // commit('UPDATE_TOAST_MESSAGE', message) // commit('UPDATE_TOAST_ALERT_TYPE', type) // commit('UPDATE_TOAST_STATUS', true) commit('ADD_TOAST', { id: Date.now(), - message, - type, + message: payload.message, + type: payload.type, }); setTimeout(() => {