This commit is contained in:
Kar
2022-11-03 21:11:29 +05:30
parent f7f833cf6d
commit 3552a1174e
4 changed files with 83 additions and 2 deletions

39
src/pages/notice/[id].vue Normal file
View File

@@ -0,0 +1,39 @@
<template>
<div class="container-fluid bg-white mx-auto mt-3 p-0">
<div v-if="isLoading">
<h2>Loading ...</h2>
</div>
<div v-else>
<div v-html="page[0].content" class="container mx-auto">
</div>
<div v-if="page[0].attachments">
<div v-html="page[0].attachments[0]"> </div>
</div>
<div>{{page[0].attachments[0]}}</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
page: null,
isLoading: true
}
},
mounted: function () {
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(data => {
this.page = data.data
console.log(data)
this.isLoading = false
})
}
}
</script>

View File

@@ -0,0 +1,40 @@
<template>
<div class="container-fluid bg-white mx-auto mt-3 p-0">
<div v-if="isLoading">
<h2>Loading ...</h2>
</div>
<div v-else>
<div v-for="(item, index) in page" >
<router-link :to="'/notice/'+item.slug"> <h3> {{item.title}}</h3> </router-link>
</div>
<!-- <div v-html="page[0].content" class="container mx-auto">
</div> -->
</div>
</div>
</template>
<script>
export default {
data() {
return {
page: null,
isLoading: true
}
},
mounted: function () {
fetch('https://api8.siliconpin.com/items/scc22?filter[type][_eq]=notice')
// fetch('https://api8.siliconpin.com/items/scc22?slug=about-us')
.then(response => response.json())
.then(data => {
this.page = data.data
console.log(data)
this.isLoading = false
})
}
}
</script>