diff --git a/src/pages/notice/[id].vue b/src/pages/notice/[id].vue index ddeb773..f043b7d 100644 --- a/src/pages/notice/[id].vue +++ b/src/pages/notice/[id].vue @@ -9,7 +9,7 @@
-
+
{{page[0].attachments[0]}}
@@ -22,6 +22,7 @@ data() { return { page: null, + attachments:[], isLoading: true } }, @@ -31,9 +32,30 @@ .then(response => response.json()) .then(data => { this.page = data.data - console.log(data) + this.page[0].attachments.forEach(element => { + fetch('https://api8.siliconpin.com/items/scc22_files_1?filter[id][_eq]='+element ) + .then(response => response.json()) + .then(attach => { + console.log(attach.data[0].directus_files_id) + this.attachments.push(attach.data[0].directus_files_id) + }) + console.log(element) + }); + // this.getAttachments(this.page[0].attachments) + // console.log(this.page[0].attachments) this.isLoading = false }) - } + }, + methods: { + // getAttachments(att) { + + // console.log(att) + // // fetch('https://api8.siliconpin.com/items/ecom55?filter[slug][_eq]=' + this.$route.params.id) + // // .then(response => response.json()) + // // .then(data => this.itemByCategory = data) + // // console.log(this.itemByCategory) + + // } + } } \ No newline at end of file