Board1One.vue_20211222

팡태(❁´◡`❁)·2021년 12월 22일
0

vue

목록 보기
33/35
<template>
    <div>
        <h3>상세페이지</h3>
        {{item.no}} {{item.title}} {{item.writer}} {{item.hit}} {{item.regdate}}
        <hr />
        <el-image :src="item.img" />
        <hr />
        {{item.content}}
        <br />
        <router-link to="/board1">목록으로</router-link>
    </div>
</template>

<script>
    import axios from 'axios';

    export default {
        created() {
            this.handleData();
        },
        data() {
            return {
                item: '',
                no: this.$route.query.no,

            }
        },

        methods: {
            async handleData() {
                const url = `http://ihongss.com/json/boardone.json?no=${this.no}`
                const headers = {"Content-Type":"application/json"};

                const response = await axios.get(url, {headers:headers});
                console.log(response);
                if(response.data.ret === 'y') {
                    this.item = response.data.data;
                }
            }
        }
    }
</script>

<style scoped>

</style>

0개의 댓글