<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>