diff --git a/src/pages/notice/[id].vue b/src/pages/notice/[id].vue index 0d4d33a..2571652 100644 --- a/src/pages/notice/[id].vue +++ b/src/pages/notice/[id].vue @@ -47,12 +47,21 @@ export default { .then(resp => resp.json()) .then(file => { this.files = file.data + // this.files = file.data this.fileAttached=true // attach.data.forEach(fileID=> this.files.push(fileID.directus_files_id)) - console.log(file.data) + // console.log(file.data) // this.attachments.push(attach.data[0].directus_files_id) }) - if(fileAttached){} + let attIDs = '' + let t = 0 + this.files.forEach(ids => { + if (t == 0) attIDs = ids + else attIDs = attIDs + ',' + ids + t++ + console.log(attIDs) + }); + if(this.fileAttached){} // console.log(Object.assign({}, this.files)) // console.log(this.files) }) diff --git a/src/pages/notice/index.vue b/src/pages/notice/index.vue index 0c4df38..99569ca 100644 --- a/src/pages/notice/index.vue +++ b/src/pages/notice/index.vue @@ -27,7 +27,7 @@ } }, mounted: function () { - fetch('https://api8.siliconpin.com/items/scc22?filter[type][_eq]=notice') + fetch('https://api8.siliconpin.com/items/scc22?filter[type][_eq]=notice&limit=-1') // fetch('https://api8.siliconpin.com/items/scc22?slug=about-us') .then(response => response.json()) .then(data => {