Simplify ContentList
This commit is contained in:
@@ -44,15 +44,11 @@ const props = defineProps({
|
|||||||
creatorId: {
|
creatorId: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
},
|
}
|
||||||
contents: {
|
|
||||||
type: Array,
|
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const client = useClient()
|
const client = useClient()
|
||||||
const contents = ref(props.contents)
|
const contents = ref([])
|
||||||
const errorMessage = ref()
|
const errorMessage = ref()
|
||||||
let last_id = null
|
let last_id = null
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="brandingStore.value.loading">
|
<div class="w-full h-full pr-4">
|
||||||
<v-progress-linear indeterminate></v-progress-linear>
|
<div v-if="brandingStore.value.loading">
|
||||||
</div>
|
<v-progress-linear indeterminate></v-progress-linear>
|
||||||
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="w-full h-full pr-4">
|
|
||||||
<content-list :creator-id="brandingStore.value.id"
|
<content-list :creator-id="brandingStore.value.id"
|
||||||
:contents="news"
|
|
||||||
></content-list>
|
></content-list>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script async setup>
|
<script async setup>
|
||||||
import { ref} from 'vue';
|
|
||||||
import {useBrandingStore} from "@/stores/brandingStore.js";
|
import {useBrandingStore} from "@/stores/brandingStore.js";
|
||||||
import ContentList from "@/views/contents/ContentList.vue";
|
import ContentList from "@/views/contents/ContentList.vue";
|
||||||
|
|
||||||
const brandingStore = useBrandingStore()
|
const brandingStore = useBrandingStore()
|
||||||
|
|
||||||
const contents = ref([])
|
|
||||||
function contentPosted(content) {
|
|
||||||
contents.value.unshift(content)
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user