api attachment
parent
3552a1174e
commit
5349e735bf
|
@ -9,7 +9,7 @@
|
|||
|
||||
</div>
|
||||
<div v-if="page[0].attachments">
|
||||
<div v-html="page[0].attachments[0]"> </div>
|
||||
<div v-html="page[0].attachments"> </div>
|
||||
|
||||
</div>
|
||||
<div>{{page[0].attachments[0]}}</div>
|
||||
|
@ -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)
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue