모달수정
This commit is contained in:
parent
1f8b4267ee
commit
e9dda8cbea
@ -32,7 +32,7 @@ const offToast = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const toastClass = computed(() => {
|
const toastClass = computed(() => {
|
||||||
return toastStore.toastType === 'error' ? 'bg-danger' : 'bg-success'; // 에러일 경우 red, 정상일 경우 blue
|
return toastStore.toastType === 'e' ? 'bg-danger' : 'bg-success'; // 에러일 경우 red, 정상일 경우 blue
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -5,14 +5,14 @@ export const useToastStore = defineStore('toastStore', {
|
|||||||
toastModal: false,
|
toastModal: false,
|
||||||
toastMsg: '',
|
toastMsg: '',
|
||||||
time: 2000,
|
time: 2000,
|
||||||
toastType: 'success', // 'success' 또는 'error'
|
toastType: 's',
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
onToast(msg = '', time = 2000, type = 'success') {
|
onToast(msg = '', type = 's', time = 2000) {
|
||||||
this.toastModal = true;
|
this.toastModal = true;
|
||||||
this.toastMsg = msg;
|
this.toastMsg = msg;
|
||||||
this.time = time;
|
|
||||||
this.toastType = type;
|
this.toastType = type;
|
||||||
|
this.time = time;
|
||||||
|
|
||||||
// 시간이 지난 후 토스트 숨기기
|
// 시간이 지난 후 토스트 숨기기
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -22,7 +22,7 @@ export const useToastStore = defineStore('toastStore', {
|
|||||||
offToast() {
|
offToast() {
|
||||||
this.toastModal = false;
|
this.toastModal = false;
|
||||||
this.toastMsg = '';
|
this.toastMsg = '';
|
||||||
this.toastType = 'success'; // 기본 상태로 초기화
|
this.toastType = 's';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user