Adds reactivity to content-list

This commit is contained in:
2024-08-16 23:40:04 -04:00
parent af51a23677
commit 245f8694ea
7 changed files with 83 additions and 51 deletions

View File

@@ -1,12 +1,15 @@
<template>
<div v-if="creator && creator.id">
<creator-banner :creator="creator"></creator-banner>
<creator-banner :creator="creator"
@content-posted="contentPosted"
></creator-banner>
<div class="max-w-[800px] mx-auto flex flex-row justify-center ">
<div class="w-full h-full mx-1">
<content-list :creator-id="creator.id">
</content-list>
<content-list :creator-id="creator.id"
:contents="contents"
></content-list>
</div>
</div>
</div>
@@ -34,11 +37,16 @@ import {useClient} from "@/plugins/api.js";
import CreatorBanner from "@/views/creators/CreatorBanner.vue";
import ContentList from "@/views/contents/ContentList.vue";
const client = useClient();
const route = useRoute();
const creator = ref(null)
const loading = ref(true)
const contents = ref([])
const creator = ref(null);
const loading = ref(true);
const client = useClient()
const route = useRoute()
function contentPosted(content) {
contents.value.unshift(content)
}
onBeforeMount(async () => await fetchCreatorData(route.params.creator))