Placehold in collections list

This commit is contained in:
joycitta-siqueira 2022-03-20 20:34:23 -03:00
parent 14b42b04b3
commit a46854120d
3 changed files with 5 additions and 11 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -10,7 +10,7 @@
<ion-item v-for="collection of collections" :key="collection.id" :router-link="`/collections/${collection.id}`">
<ion-thumbnail slot="start">
<ion-img v-if="collection.thumbnail.thumbnail[0]" :src="collection.thumbnail.thumbnail[0]" :alt="collection.name"></ion-img>
<ion-img v-else src="https://cdn.icon-icons.com/icons2/1506/PNG/512/emblemok_103757.png" :alt="collection.name"></ion-img>
<ion-img v-else :src="image" :alt="collection.name"></ion-img>
</ion-thumbnail>
<ion-label> {{ collection.name }} </ion-label>
</ion-item>
@ -28,7 +28,7 @@ import {
IonLabel,
} from '@ionic/vue';
import BaseLayout from '@/components/base/BaseLayout.vue';
import { ref } from 'vue';
import { computed, ref } from 'vue';
export default {
components: {
IonList,
@ -40,9 +40,10 @@ export default {
BaseLayout
},
setup() {
const image = computed (() => require('../assets/placeholder_square_small.png'))
const isOpenRef = ref(false);
const setOpen = (state: boolean) => isOpenRef.value = state;
return { isOpenRef, setOpen }
return { image, isOpenRef, setOpen }
},
data() {
return {
@ -52,11 +53,7 @@ export default {
created(){
this.setOpen(true)
<<<<<<< HEAD
fetch("https://rcteste.tainacan.org/wp-json/tainacan/v2/collections?perpage=4&orderby=modified")
=======
fetch("https://museucasadahera.acervos.museus.gov.br/wp-json/tainacan/v2/collections?perpage=4&orderby=modified")
>>>>>>> 7d57280a1235f0b4c6864010e4feac7f103b38fd
.then((response) => response.json())
.then((data) => {
this.collections = data;

View File

@ -42,11 +42,8 @@ export default {
created(){
this.setOpen(true)
<<<<<<< HEAD
fetch(`https://rcteste.tainacan.org/wp-json/tainacan/v2/collection/${this.collectionId}/items`)
=======
fetch(`https://museucasadahera.acervos.museus.gov.br/wp-json/tainacan/v2/collection/${this.collectionId}/items`)
>>>>>>> 7d57280a1235f0b4c6864010e4feac7f103b38fd
// fetch(`https://museucasadahera.acervos.museus.gov.br/wp-json/tainacan/v2/collection/${this.collectionId}/items`)
.then((response) => response.json())
.then((data) => {
this.items = data.items;