Skip to content
Snippets Groups Projects
Select Git revision
  • 93204f6985faa7a471de6eec0d94751b6d8b5f66
  • master default
2 results

command_parsing_test.cc

Blame
  • Forked from sce213ta / mysh-1
    Source project has a limited visibility.
    Post.vue 2.34 KiB
    <!--활동 일지 글 쓸 때-->
    <template>
        <div class="posting">
            <NavClub id="navClub">가나다</NavClub>
            <div class="board">
                <h4 style="display:inline">제목:</h4>
                <input type="text" class="content" v-model="title" required>
                <h4>내용</h4>
                <textarea style="resize:none;" cols="60" rows="13" v-model="content" placeholder="게시글을 작성하세요." class="content" required></textarea>
            </div>  
            <br>
            <button @click="cancel">취소</button>
            <button @click="post">게시</button>
        </div>
    </template>
    <script>
    import router from "../router/index"
    import NavClub from '@/components/NavClub.vue'
    import axios from "axios"
    import {mapState} from "vuex"
    export default {
        components: {
            'NavClub': NavClub
        },
        data(){
            return {
                club:[{
                    id:'',
                }],
                title:'',
                content:'',
    
            }
        },
        methods: {
            post(){
                if(this.title != '' && this.content != ''){
                    let id = this.$route.params.clubId;
                    axios.post(`http://jnhonlinux.ddns.net:3000/activityLog/${id}`, {
                        title: this.title,
                        content: this.content,
                        writer: this.userInfo.name,
                        // c_id: this.club[0].id
                    })
                    router.push(`/club_post/${id}`)
                }
                if(this.title == '' && this.content != ''){
                    alert("제목을 써주세요.")
                }
                if(this.title != '' && this.content == ''){
                    alert("내용을 써주세요.")
                }
                if(this.title == '' && this.content == ''){
                    alert("제목과 내용을 써주세요.")
                }
            },
            cancel(){
                let id = this.$route.params.clubId;
                router.push(`/club_post/${id}`)
            }  
        },
        async created() {
          let id = this.$route.params.clubId;
            const res = await this.$http.get(`http://jnhonlinux.ddns.net:3000/club/${id}`)
                this.club = res.data.result
        },
        computed:{
          ...mapState(['userInfo'])
        }
    }
    </script>
    <style scoped>
    .board {
        display:inline-block;
        margin-top: 15px;
        padding-top: 15px;
        border: 1px solid #000;
    }
    .content {
        margin-left: 15px;
    }
    </style>