Adds reactivity to content-list
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user