Compare commits
No commits in common. "b9e6cbca021e2456c3de67f8c8ea7dbbe9bedc21" and "3552a1174e184daaef26e2f91a858e511c60a931" have entirely different histories.
b9e6cbca02
...
3552a1174e
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col h-screen justify-between">
|
<div>
|
||||||
<Header />
|
<Header />
|
||||||
<main>
|
<main>
|
||||||
<router-view />
|
<router-view />
|
||||||
|
|
|
@ -8,73 +8,32 @@
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="files">
|
<div v-if="page[0].attachments">
|
||||||
<h2>Attachments</h2>
|
<div v-html="page[0].attachments[0]"> </div>
|
||||||
<div v-for="(file, index) in files">
|
|
||||||
{{index+1}}<a :href="'https://api8.siliconpin.com/assets/' + file.directus_files_id">
|
|
||||||
<h3> {{ file.directus_files_id }}</h3>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div>{{page[0].attachments[0]}}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
</div>
|
<script>
|
||||||
<!-- <div>{{page[0].attachments[0]}}</div> -->
|
export default {
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
page: null,
|
page: null,
|
||||||
files: [],
|
|
||||||
isLoading: true
|
isLoading: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
fetch('https://api8.siliconpin.com/items/scc22?filter[slug][_eq]=' + this.$route.params.id)
|
fetch('https://api8.siliconpin.com/items/scc22?filter[slug][_eq]=' + this.$route.params.id)
|
||||||
|
// fetch('https://api8.siliconpin.com/items/scc22?slug=about-us')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
this.page = data.data
|
this.page = data.data
|
||||||
let attIDs = ''
|
console.log(data)
|
||||||
let t = 0
|
|
||||||
this.page[0].attachments.forEach(ids => {
|
|
||||||
if (t == 0) attIDs = ids
|
|
||||||
else attIDs = attIDs + ',' + ids
|
|
||||||
t++
|
|
||||||
// console.log(ids)
|
|
||||||
});
|
|
||||||
// console.log(attIDs)
|
|
||||||
// this.getAttachments(this.page[0].attachments)
|
|
||||||
// console.log(this.page[0].attachments)
|
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
|
|
||||||
fetch('https://api8.siliconpin.com/items/scc22_files_1?filter[id][_in]=' + attIDs)
|
|
||||||
.then(resp => resp.json())
|
|
||||||
.then(file => {
|
|
||||||
this.files = file.data
|
|
||||||
// attach.data.forEach(fileID=> this.files.push(fileID.directus_files_id))
|
|
||||||
console.log(file.data)
|
|
||||||
// this.attachments.push(attach.data[0].directus_files_id)
|
|
||||||
})
|
})
|
||||||
// console.log(Object.assign({}, this.files))
|
|
||||||
// console.log(this.files)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
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>
|
</script>
|
Loading…
Reference in New Issue