38 lines
842 B
Vue
38 lines
842 B
Vue
<template>
|
|
<div class="modal">
|
|
<div class="modal-content">
|
|
<h3>휴가 추가</h3>
|
|
<input type="text" v-model="title" placeholder="제목" />
|
|
<input type="date" v-model="date" />
|
|
<button @click="addEvent">추가</button>
|
|
<button @click="$emit('close')">닫기</button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import calendarStore from '@s/calendarStore';
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
title: '',
|
|
date: '',
|
|
};
|
|
},
|
|
methods: {
|
|
addEvent() {
|
|
if (this.title && this.date) {
|
|
calendarStore.addEvent({ title: this.title, start: this.date });
|
|
this.$emit('close');
|
|
} else {
|
|
alert('모든 필드를 입력해주세요.');
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
</style>
|